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/", line 56, in application
    response = frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 52, in execute_cmd
    return, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 913, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/", line 71, in getdoctype
    docs = get_meta_bundle(doctype)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/", line 82, in get_meta_bundle
    bundle = [frappe.desk.form.meta.get_meta(doctype)]
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/", line 24, in get_meta
    meta = FormMeta(doctype)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/", line 34, in __init__
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/", line 41, in load_assets
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/", line 64, in add_code
    path = os.path.join(get_module_path(self.module), 'doctype', scrub(
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/", line 144, in get_module_path
    return frappe.get_module_path(module)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", 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.


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


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?


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