Form/Data Import/Oven Approued Quantty Import on 2024-10-12 12:21:10.973153
Traceback
code
Assistant
The error message indicates that there is an ImportError when trying to work with a document of type "Oven Approued Quantty" in your system. This suggests that the system cannot find or recognize the "Oven Approued Quantty" doctype, which might be due to a typo or a missing doctype definition in your application.
Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 95, in application
response = frappe.api.handle()
File "apps/frappe/frappe/api.py", line 55, in handle
return frappe.handler.handle()
File "apps/frappe/frappe/handler.py", line 48, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 86, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/__init__.py", line 1619, in call
return fn(*args, **newargs)
File "apps/frappe/frappe/desk/form/save.py", line 31, in savedocs
doc.save()
File "apps/frappe/frappe/model/document.py", line 310, in save
return self._save(*args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 345, in _save
self.run_before_save_methods()
File "apps/frappe/frappe/model/document.py", line 1061, in run_before_save_methods
self.run_method("validate")
File "apps/frappe/frappe/model/document.py", line 931, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1283, in composer
return composed(self, method, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1265, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "apps/frappe/frappe/model/document.py", line 928, in fn
return method_object(*args, **kwargs)
File "apps/frappe/frappe/core/doctype/data_import/data_import.py", line 31, in validate
self.set_payload_count()
File "apps/frappe/frappe/core/doctype/data_import/data_import.py", line 46, in set_payload_count
payloads = i.import_file.get_payloads_for_import()
File "apps/frappe/frappe/core/doctype/data_import/importer.py", line 519, in get_payloads_for_import
doc, rows, data = self.parse_next_row_for_import(data)
File "apps/frappe/frappe/core/doctype/data_import/importer.py", line 556, in parse_next_row_for_import
parent_doc = row.parse_doc(doctype)
File "apps/frappe/frappe/core/doctype/data_import/importer.py", line 651, in parse_doc
doc = self._parse_doc(doctype, columns, values, parent_doc, table_df)
File "apps/frappe/frappe/core/doctype/data_import/importer.py", line 658, in _parse_doc
doc = frappe.new_doc(
File "apps/frappe/frappe/__init__.py", line 1079, in new_doc
return get_new_doc(doctype, parent_doc, parentfield, as_dict=as_dict)
File "apps/frappe/frappe/model/create_new.py", line 22, in get_new_doc
frappe.local.new_doc_templates[doctype] = make_new_doc(doctype)
File "apps/frappe/frappe/model/create_new.py", line 35, in make_new_doc
doc = frappe.get_doc({"doctype": doctype, "__islocal": 1, "owner": frappe.session.user, "docstatus": 0})
File "apps/frappe/frappe/__init__.py", line 1200, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 76, in get_doc
controller = get_controller(doctype)
File "apps/frappe/frappe/model/base_document.py", line 90, in get_controller
return _get_controller()
File "apps/frappe/frappe/model/base_document.py", line 86, in _get_controller
raise ImportError(doctype)
ImportError: Oven Approued Quantty
Here’s a step-by-step guide to troubleshooting and fixing the issue:
Verify Doctype Existence:
Ensure that the doctype "Oven Approued Quantty" actually exists in your Frappe/ERPNext application.
Go to the Doctype list page in your application and confirm that it is listed there.
Check for Typographical Errors:
The error and request data both reference "Oven Approued Quantty." Ensure that this is the correct spelling and matches exactly with how it is defined in your doctype.
Check the CSV file name and content for any typos as well.
Database Synchronization:
If the doctype has recently been added or modified, ensure that the database schema has been properly migrated. Run bench migrate to apply any outstanding changes to the database.
Codebase Updates:
If the doctype was added or changed recently, make sure all necessary code changes have been pulled into your current environment if you're using version control (e.g., Git).
Check Error Logs:
Examine logs for any more detailed errors that might indicate why the doctype cannot be found. The logs can usually be found in the logs directory of your bench setup.
Permissions and Access:
Verify that the user performing the operation has the necessary permissions to access and create documents of the specified doctype.
Rebuild JavaScript/CSS:
Sometimes front-end components or caches might cause issues. Run bench build to rebuild front-end assets.
Validation of File Path:
Check the file path (“/private/files/Ouen Approued Quantty.csv”) for the CSV being imported to ensure there are no typos and the file exists at the specified location.
By following these steps, you'll be able to identify why the "Oven Approued Quantty" doctype is not recognized by your system and resolve the issue accordingly.