[SOLVED] DocType Import Error while trying to add new instance (record)

Traceback (most recent call last): File "/home/marcin/frappe-bench/apps/frappe/frappe/app.py", line 55, in application response = frappe.handler.handle() File "/home/marcin/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle execute_cmd(cmd) File "/home/marcin/frappe-bench/apps/frappe/frappe/handler.py", line 36, in execute_cmd ret = frappe.call(method, **frappe.form_dict) File "/home/marcin/frappe-bench/apps/frappe/frappe/__init__.py", line 876, in call return fn(*args, **newargs) File "/home/marcin/frappe-bench/apps/frappe/frappe/client.py", line 83, in insert doc = frappe.get_doc(doc).insert() File "/home/marcin/frappe-bench/apps/frappe/frappe/__init__.py", line 578, in get_doc return frappe.model.document.get_doc(arg1, arg2) File "/home/marcin/frappe-bench/apps/frappe/frappe/model/document.py", line 44, in get_doc controller = get_controller(doctype) File "/home/marcin/frappe-bench/apps/frappe/frappe/model/base_document.py", line 41, in get_controller raise ImportError, doctype ImportError: SA Customer

Only when i use name which contains “Customer” I get such an error while adding new record.
Not sure what can I do about it (flush something or delete?) maybe it’s a bug.

Strange but after doing following things it worked:

  • Remove directory from your_app/doctype/doctype_name
  • Remove doctype from the list in gui (which removes from DB)
  • Run bench migrate

Please close this topic.

1 Like

Hello i know it’s been a while but did you have to recreate the doctype after deleting it and run bench migrate?

try to commit of Deleted Doctype and then use bench migrate.

Thanks
Sagar Shiragawakar

Thanks for the reply saw this too late, solved it by rcereating the doctype