Traceback with variables (most recent call last):
File “apps/frappe/frappe/core/doctype/data_import/data_import.py”, line 110, in start_import
i.import_data()
data_import = <DataImport: Item Import on 2024-09-25 16:27:47.935770>
i = <frappe.core.doctype.data_import.importer.Importer object at 0x7f0b26f05d80>
File “apps/frappe/frappe/core/doctype/data_import/importer.py”, line 78, in import_data
payloads = self.import_file.get_payloads_for_import()
self = <frappe.core.doctype.data_import.importer.Importer object at 0x7f0b26f05d80>
File “apps/frappe/frappe/core/doctype/data_import/importer.py”, line 509, in get_payloads_for_import
doc, rows, data = self.parse_next_row_for_import(data)
self = <frappe.core.doctype.data_import.importer.ImportFile object at 0x7f0b26e0f040>
payloads =
data = [<frappe.core.doctype.data_import.importer.Row object at 0x7f0b26b5b760>]
File “apps/frappe/frappe/core/doctype/data_import/importer.py”, line 546, in parse_next_row_for_import
parent_doc = row.parse_doc(doctype)
self = <frappe.core.doctype.data_import.importer.ImportFile object at 0x7f0b26e0f040>
data = [<frappe.core.doctype.data_import.importer.Row object at 0x7f0b26b5b760>]
doctypes = [(‘Item’, None)]
first_row = <frappe.core.doctype.data_import.importer.Row object at 0x7f0b26b5b760>
rows = [<frappe.core.doctype.data_import.importer.Row object at 0x7f0b26b5b760>]
row = <frappe.core.doctype.data_import.importer.Row object at 0x7f0b26b5b760>
parent_doc = None
doctype = ‘Item’
table_df = None
File “apps/frappe/frappe/core/doctype/data_import/importer.py”, line 643, in parse_doc
doc = self._parse_doc(doctype, columns, values, parent_doc, table_df)
self = <frappe.core.doctype.data_import.importer.Row object at 0x7f0b26b5b760>
doctype = ‘Item’
parent_doc = None
table_df = None
col_indexes = [0, 1, 2, 3]
values = [‘SGP.03’, ‘Product RnD’, ‘Unit’, ‘Stencil Coba’]
columns = [<frappe.core.doctype.data_import.importer.Column object at 0x7f0b26b5bf70>, <frappe.core.doctype.data_import.importer.Column object at 0x7f0b26b5bf10>, <frappe.core.doctype.data_import.importer.Column object at 0x7f0b26b5b220>, <frappe.core.doctype.data_import.importer.Column object at 0x7f0b26bb40a0>]
File “apps/frappe/frappe/core/doctype/data_import/importer.py”, line 650, in _parse_doc
doc = frappe.new_doc(
self = <frappe.core.doctype.data_import.importer.Row object at 0x7f0b26b5b760>
doctype = ‘Item’
columns = [<frappe.core.doctype.data_import.importer.Column object at 0x7f0b26b5bf70>, <frappe.core.doctype.data_import.importer.Column object at 0x7f0b26b5bf10>, <frappe.core.doctype.data_import.importer.Column object at 0x7f0b26b5b220>, <frappe.core.doctype.data_import.importer.Column object at 0x7f0b26bb40a0>]
values = [‘SGP.03’, ‘Product RnD’, ‘Unit’, ‘Stencil Coba’]
parent_doc = None
table_df = None
doc = {}
File “apps/frappe/frappe/init.py”, line 1067, in new_doc
new_doc = get_new_doc(doctype, parent_doc, parentfield, as_dict=as_dict)
doctype = ‘Item’
parent_doc = None
parentfield = None
as_dict = True
kwargs = {}
get_new_doc = <function get_new_doc at 0x7f0b26a83d90>
File “apps/frappe/frappe/model/create_new.py”, line 22, in get_new_doc
frappe.local.new_doc_templates[doctype] = make_new_doc(doctype)
doctype = ‘Item’
parent_doc = None
parentfield = None
as_dict = True
File “apps/frappe/frappe/model/create_new.py”, line 35, in make_new_doc
doc = frappe.get_doc(
doctype = ‘Item’
File “apps/frappe/frappe/init.py”, line 1212, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
args = ({‘doctype’: ‘Item’, ‘__islocal’: 1, ‘owner’: ‘Administrator’, ‘docstatus’: 0},)
kwargs = {}
frappe = <module ‘frappe’ from ‘apps/frappe/frappe/init.py’>
File “apps/frappe/frappe/model/document.py”, line 73, in get_doc
controller = get_controller(doctype)
args = ({‘doctype’: ‘Item’, ‘__islocal’: 1, ‘owner’: ‘Administrator’, ‘docstatus’: 0},)
kwargs = {‘doctype’: ‘Item’, ‘__islocal’: 1, ‘owner’: ‘Administrator’, ‘docstatus’: 0}
doctype = ‘Item’
File “apps/frappe/frappe/model/base_document.py”, line 51, in get_controller
site_controllers[doctype] = import_controller(doctype)
doctype = ‘Item’
site_controllers = {‘Data Import’: <class ‘frappe.core.doctype.data_import.data_import.DataImport’>, ‘File’: <class ‘frappe.core.doctype.file.file.File’>}
File “apps/frappe/frappe/model/base_document.py”, line 76, in import_controller
module = load_doctype_module(doctype, module_name)
doctype = ‘Item’
Document = <class ‘frappe.model.document.Document’>
NestedSet = <class ‘frappe.utils.nestedset.NestedSet’>
module_name = ‘Stock’
doctype_info = {‘name’: ‘Item’, ‘creation’: datetime.datetime(2013, 5, 3, 10, 45, 46), ‘modified’: datetime.datetime(2023, 2, 14, 4, 48, 26, 343620), ‘modified_by’: ‘Administrator’, ‘owner’: ‘Administrator’, ‘docstatus’: 0, ‘idx’: 2, ‘search_fields’: ‘item_name,description,item_group,customer_code’, ‘issingle’: 0, ‘is_tree’: 0, ‘istable’: 0, ‘editable_grid’: 1, ‘track_changes’: 1, ‘module’: ‘Stock’, ‘restrict_to_domain’: None, ‘app’: None, ‘autoname’: ‘field:item_code’, ‘naming_rule’: ‘By fieldname’, ‘title_field’: ‘item_name’, ‘image_field’: ‘image’, ‘timeline_field’: None, ‘sort_field’: ‘modified’, ‘sort_order’: ‘DESC’, ‘description’: ‘A Product or a Service that is bought, sold or kept in stock.’, ‘colour’: None, ‘read_only’: 0, ‘in_create’: 0, ‘menu_index’: None, ‘parent_node’: None, ‘smallicon’: None, ‘allow_copy’: 0, ‘allow_rename’: 1, ‘allow_import’: 1, ‘hide_toolbar’: 0, ‘track_seen’: 0, ‘max_attachments’: 0, ‘print_outline’: None, ‘document_type’: ‘Setup’, ‘icon’: ‘fa fa-tag’, ‘color’: None,…
module_path = None
class_overrides = {‘Address’: [‘erpnext.accounts.custom.address.ERPNextAddress’], ‘Employee’: [‘hrms.overrides.employee_master.EmployeeMaster’], ‘Timesheet’: [‘hrms.overrides.employee_timesheet.EmployeeTimesheet’], ‘Payment Entry’: [‘hrms.overrides.employee_payment_entry.EmployeePaymentEntry’], ‘Project’: [‘hrms.overrides.employee_project.EmployeeProject’]}
File “apps/frappe/frappe/modules/utils.py”, line 245, in load_doctype_module
raise ImportError(msg) from e
doctype = ‘Item’
module = ‘Stock’
prefix = ‘’
suffix = ‘’
app = ‘erpnext’
key = ********
module_name = ‘erpnext.stock.doctype.item.item’
msg = “Module import failed for Item, the DocType you’re trying to open might be deleted.
Error: cannot import name ‘HeaderWriteError’ from ‘email.errors’ (/usr/lib/python3.10/email/errors.py)”
builtins.ImportError: Module import failed for Item, the DocType you’re trying to open might be deleted.
Error: cannot import name ‘HeaderWriteError’ from ‘email.errors’ (/usr/lib/python3.10/email/errors.py)
Please, help.
Solved this bug in data import