Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import error on doctype #26181

Open
ajiragroup opened this issue Apr 27, 2024 · 0 comments
Open

Import error on doctype #26181

ajiragroup opened this issue Apr 27, 2024 · 0 comments
Labels

Comments

@ajiragroup
Copy link
Contributor

I am trying to create a new doctype (in Developer mode) but I am getting “Import error” when saving the doctype. Also, same error appears when trying to save the form.
App Versions

{
"erpnext": "15.20.6",
"frappe": "15.23.0",
"insights": "1.1.3",
"wiki": "2.0.0"
}

Route

Form/DocType/Design

Traceback

Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 110, in application
response = frappe.api.handle(request)
File "apps/frappe/frappe/api/init.py", line 49, in handle
data = endpoint(**arguments)
File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
return frappe.handler.handle()
File "apps/frappe/frappe/handler.py", line 49, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/init.py", line 1718, in call
return fn(*args, **newargs)
File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
return func(*args, **kwargs)
File "apps/frappe/frappe/desk/form/save.py", line 39, in savedocs
doc.save()
File "apps/frappe/frappe/model/document.py", line 337, in save
return self._save(*args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 390, in _save
self.run_post_save_methods()
File "apps/frappe/frappe/model/document.py", line 1128, in run_post_save_methods
self.run_method("on_update")
File "apps/frappe/frappe/model/document.py", line 962, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1322, in composer
return composed(self, method, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1304, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "apps/frappe/frappe/model/document.py", line 959, in fn
return method_object(*args, **kwargs)
File "apps/frappe/frappe/core/doctype/doctype/doctype.py", line 526, in on_update
self.export_types_to_controller()
File "apps/frappe/frappe/core/doctype/doctype/doctype.py", line 860, in export_types_to_controller
TypeExporter(self).export_types()
File "apps/frappe/frappe/types/exporter.py", line 62, in init
self.controller_path = Path(inspect.getfile(get_controller(self.doctype)))
File "apps/frappe/frappe/model/base_document.py", line 70, in get_controller
site_controllers[doctype] = import_controller(doctype)
File "apps/frappe/frappe/model/base_document.py", line 100, in import_controller
raise ImportError(
ImportError: Design

Request Data

{
"type": "POST",
"args": {
"doc": "{"name":"Design","creation":"2024-04-25 12:21:56.815500","modified":"2024-04-25 12:33:48.227034","modified_by":"Administrator","owner":"Administrator","docstatus":0,"idx":0,"issingle":0,"is_tree":0,"istable":0,"editable_grid":0,"track_changes":0,"module":"Designs","naming_rule":"","sort_field":"modified","sort_order":"DESC","read_only":0,"in_create":0,"allow_copy":0,"allow_rename":1,"allow_import":0,"hide_toolbar":0,"track_seen":0,"max_attachments":0,"document_type":"","engine":"InnoDB","is_submittable":1,"show_name_in_global_search":0,"custom":0,"beta":0,"has_web_view":0,"allow_guest_to_view":0,"email_append_to":0,"show_title_field_in_link":0,"translated_doctype":0,"is_calendar_and_gantt":0,"quick_entry":0,"track_views":0,"is_virtual":0,"queue_in_background":0,"allow_events_in_timeline":0,"allow_auto_repeat":0,"make_attachments_public":0,"force_re_route_to_default_view":0,"show_preview_popup":0,"index_web_pages_for_search":1,"doctype":"DocType","permissions":[{"name":"a36e28bd05","creation":"2024-04-25 12:21:56.815500","modified":"2024-04-25 12:33:48.227034","modified_by":"Administrator","owner":"Administrator","docstatus":0,"parent":"Design","parentfield":"permissions","parenttype":"DocType","idx":1,"permlevel":0,"role":"System Manager","read":1,"write":1,"create":1,"submit":1,"cancel":0,"delete":1,"amend":0,"report":1,"export":1,"import":0,"share":1,"print":1,"email":1,"if_owner":0,"select":0,"doctype":"DocPerm"}],"fields":[{"docstatus":0,"doctype":"DocField","name":"new-docfield-tjbjaxwcgf","__islocal":1,"__unsaved":1,"owner":"Administrator","fieldtype":"Section Break","precision":"","non_negative":0,"hide_days":0,"hide_seconds":0,"reqd":0,"is_virtual":0,"search_index":0,"sort_options":0,"show_dashboard":0,"fetch_if_empty":0,"hidden":0,"bold":0,"allow_in_quick_entry":0,"translatable":0,"print_hide":0,"print_hide_if_no_value":0,"report_hide":0,"collapsible":0,"hide_border":0,"in_list_view":0,"in_standard_filter":0,"in_preview":0,"in_filter":0,"in_global_search":0,"read_only":0,"allow_on_submit":0,"ignore_user_permissions":0,"allow_bulk_edit":0,"permlevel":0,"ignore_xss_filter":0,"unique":0,"no_copy":0,"set_only_once":0,"remember_last_selected_value":0,"parent":"Design","parentfield":"fields","parenttype":"DocType","idx":1,"fieldname":"section_break_kjnh","show_preview_popup":0,"columns":0,"length":0},{"docstatus":0,"doctype":"DocField","name":"new-docfield-dcnmburfnc","__islocal":1,"__unsaved":1,"owner":"Administrator","fieldtype":"Select","precision":"","non_negative":0,"hide_days":0,"hide_seconds":0,"reqd":0,"is_virtual":0,"search_index":0,"sort_options":0,"show_dashboard":0,"fetch_if_empty":0,"hidden":0,"bold":0,"allow_in_quick_entry":0,"translatable":0,"print_hide":0,"print_hide_if_no_value":0,"report_hide":0,"collapsible":0,"hide_border":0,"in_list_view":0,"in_standard_filter":0,"in_preview":0,"in_filter":0,"in_global_search":0,"read_only":0,"allow_on_submit":0,"ignore_user_permissions":0,"allow_bulk_edit":0,"permlevel":0,"ignore_xss_filter":0,"unique":0,"no_copy":0,"set_only_once":0,"remember_last_selected_value":0,"parent":"Design","parentfield":"fields","parenttype":"DocType","idx":2,"__run_link_triggers":1,"fieldname":"series","label":"Series","options":"DE-.YY.###"},{"docstatus":0,"doctype":"DocField","name":"new-docfield-rsthwwtsie","__islocal":1,"__unsaved":1,"owner":"Administrator","fieldtype":"Section Break","precision":"","non_negative":0,"hide_days":0,"hide_seconds":0,"reqd":0,"is_virtual":0,"search_index":0,"sort_options":0,"show_dashboard":0,"fetch_if_empty":0,"hidden":0,"bold":0,"allow_in_quick_entry":0,"translatable":0,"print_hide":0,"print_hide_if_no_value":0,"report_hide":0,"collapsible":0,"hide_border":0,"in_list_view":0,"in_standard_filter":0,"in_preview":0,"in_filter":0,"in_global_search":0,"read_only":0,"allow_on_submit":0,"ignore_user_permissions":0,"allow_bulk_edit":0,"permlevel":0,"ignore_xss_filter":0,"unique":0,"no_copy":0,"set_only_once":0,"remember_last_selected_value":0,"parent":"Design","parentfield":"fields","parenttype":"DocType","idx":3,"__run_link_triggers":1,"fieldname":"section_break_emvt","label":""},{"docstatus":0,"doctype":"DocField","name":"new-docfield-xvntfipagv","__islocal":1,"__unsaved":1,"owner":"Administrator","fieldtype":"Link","precision":"","non_negative":0,"hide_days":0,"hide_seconds":0,"reqd":0,"is_virtual":0,"search_index":1,"sort_options":0,"show_dashboard":0,"fetch_if_empty":0,"hidden":0,"bold":0,"allow_in_quick_entry":0,"translatable":0,"print_hide":1,"print_hide_if_no_value":0,"report_hide":0,"collapsible":0,"hide_border":0,"in_list_view":0,"in_standard_filter":0,"in_preview":0,"in_filter":0,"in_global_search":0,"read_only":1,"allow_on_submit":0,"ignore_user_permissions":0,"allow_bulk_edit":0,"permlevel":0,"ignore_xss_filter":0,"unique":0,"no_copy":1,"set_only_once":0,"remember_last_selected_value":0,"parent":"Design","parentfield":"fields","parenttype":"DocType","idx":4,"fieldname":"amended_from","label":"Amended From","options":"Design","show_preview_popup":0,"columns":0,"length":0}],"actions":[],"states":[],"links":[],"__unsaved":1}",
"action": "Save"
},
"btn": {
"jQuery370096819266448346531": {
"events": {
"click": [
{
"type": "click",
"origType": "click",
"guid": 837,
"namespace": ""
}
]
}
}
},
"freeze": true,
"headers": {},
"error_handlers": {},
"url": "/api/method/frappe.desk.form.save.savedocs",
"request_id": null
}

Response Data

{
"exception": "ImportError: Design",
"exc_type": "ImportError"
}

@ajiragroup ajiragroup added the bug label Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant