Cannot access DocType on New Module

I have ERPNext running in production mode and I made a new Module named ‘GST’. In that module, I made a new doctype called ''test".

After running bench migrate and bench build and clicking on the doctype, I got the following error:

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 56, in application
    response = frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 52, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 913, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/load.py", line 71, in getdoctype
    docs = get_meta_bundle(doctype)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/load.py", line 82, in get_meta_bundle
    bundle = [frappe.desk.form.meta.get_meta(doctype)]
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/meta.py", line 24, in get_meta
    meta = FormMeta(doctype)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/meta.py", line 34, in __init__
    self.load_assets()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/meta.py", line 41, in load_assets
    self.add_code()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/meta.py", line 64, in add_code
    path = os.path.join(get_module_path(self.module), 'doctype', scrub(self.name))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py", line 144, in get_module_path
    return frappe.get_module_path(module)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 694, in get_module_path
    return get_pymodule_path(local.module_app[module] + "." + module, *joins)
KeyError: u'gst'

I saw this answer

But I cannot figure out how to give permissions to create modules in production mode.

Help required urgently please.

@pranavgoel25,

In production mode the python files for modules are not created, please set the developer_mode on your development setup and create new module and add doctypes and push and pull the changes to your production setup to resolve the issue

@makarand_b,

For clarification, I make a development setup, create my module and doctypes, push the files into a temp git repo and then pull that git repo in my production setup. Is that right?

How will the databases created for the new DocTypes be copied from development to production?

yes,

In migration process the doctype will be synced and created if not available