Error opening newly created DocType after last update

Hi there,

i’m getting an error on newly created doctype:

Error raised when opening the Doctype:

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/load.py", line 32, in getdoc
    doc = frappe.get_doc(doctype, name)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 596, in get_doc
    return frappe.model.document.get_doc(arg1, arg2)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 48, in get_doc
    controller = get_controller(doctype)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 34, in get_controller
    module = load_doctype_module(doctype, module_name)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py", line 173, in load_doctype_module
    raise ImportError, 'Module import failed for {0} ({1})'.format(doctype, module_name)
ImportError: Module import failed for Lkd Sync Settings (istorecast_lkd.istorecast_lkd_sync.doctype.lkd_sync_settings.lkd_sync_settings)

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 55, in application
    response = frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle
    execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 40, in execute_cmd
    ret = frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 896, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/load.py", line 32, in getdoc
    doc = frappe.get_doc(doctype, name)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 596, in get_doc
    return frappe.model.document.get_doc(arg1, arg2)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 48, in get_doc
    controller = get_controller(doctype)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 34, in get_controller
    module = load_doctype_module(doctype, module_name)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py", line 173, in load_doctype_module
    raise ImportError, 'Module import failed for {0} ({1})'.format(doctype, module_name)
ImportError: Module import failed for Lkd Sync Settings (istorecast_lkd.istorecast_lkd_sync.doctype.lkd_sync_settings.lkd_sync_settings)

Cant understand what’s wrong with that …any hint?

Opened an issue: frappe/#2546

Thx in advance

@JoEz you should be able to alteast read the trace by now! This is related to your custom module.

@rmehta yeah, i’m not yet that stupid, I got it is related to the custom module …but I can’t find the reason

The module has been created in the same way of all the others custom modules, created a Doctype and added a validation method

i’ve created it 2 times but the error is still there.

I’ll create it from scratch again …

@rmehta ok …new test …

  1. Created a new app using: bench new-app test_lkd
  2. Installed app to site using: bench --site site.dev install-app test_lkd
  3. Adding a new Doctype, as Single, to the app module Test Lkd to be show in module section Setup, see pic:

Saving the doctype:

Error raised:

Opened an Issue on frappe/2548, can you please double check?

Update: Same test failing adding Single DocType to stock module