AttributeError: 'NoneType' object has no attribute 'item_name'

Hello ERPNext Developer,

Error show in HSN For Outward Suppliers Report and GST Itemised Sales Register Report

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 67, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/api.py”, line 58, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 30, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 70, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1134, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 566, in wrapper_fn
retval = fn(*args, **get_newargs(fn, kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/query_report.py”, line 227, in run
result = generate_report_result(report, filters, user, custom_columns)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/query_report.py”, line 75, in generate_report_result
res = report.execute_script_report(filters)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/report/report.py”, line 124, in execute_script_report
res = self.execute_module(filters)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/report/report.py”, line 141, in execute_module
return frappe.get_attr(method_name)(frappe._dict(filters))
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/report/gst_itemised_sales_register/gst_itemised_sales_register.py”, line 28, in execute
‘gst_hsn_code’
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py”, line 55, in _execute
‘item_name’: item_record.item_name,
AttributeError: ‘NoneType’ object has no attribute ‘item_name’

Could anybody help please?

Hi
Same error facing. Is any solution for this.

Thanks

Hi @benjaminrosary

This error will appear if the item code is missing in the sales invoice.

Thanks