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

When i try to generate Item Wise Sales History report i get the error.

Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/prepared_report/prepared_report.py", line 47, in run_background
user=instance.owner
File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/query_report.py", line 65, in generate_report_result
res = report.execute_script_report(filters)
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/report/report.py", line 120, in execute_script_report
res = self.execute_module(filters)
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/report/report.py", line 137, in execute_module
return frappe.get_attr(method_name)(frappe._dict(filters))
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py", line 16, in execute
data = get_data(filters)
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py", line 164, in get_data
"customer_name": customer_record.customer_name,
AttributeError: 'NoneType' object has no attribute 'customer_name'

I am getting AttributeError: 'NoneType' object has no attribute 'item_name' error on Item Wise Sales History Report

Was anyone able to solve this issue?

Hi! Has anyone been able to solve the issue? I’m facing this on particular date ranges of Item-wise sales register. Thanks for the help.

I no longer have the issue now. I am able to get the report now. Don’t exactly remember how i did solve it. But it had something to do with python version. By default it was using Python 2.7 version so i guess this version does not support to get the report. Check for your default python version.