Report Error : Item Wise Purchase History


I encountered this error when trying to load Item-Wise Purchase Register/History report:

Traceback (innermost last):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/”, line 51, in application
response = frappe.handler.handle()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/”, line 66, in handle
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/”, line 89, in execute_cmd
ret =, **frappe.form_dict)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/”, line 741, in call
return fn(*args, **newargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/”, line 87, in run
columns, result = frappe.get_attr(method_name)(frappe._dict(filters))
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/accounts/report/item_wise_purchase_register/”, line 14, in execute
item_list = get_items(filters)
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/accounts/report/item_wise_purchase_register/”, line 76, in get_items
order by pi.posting_date desc, pi_item.item_code desc"“” % (conditions, match_conditions), filters, as_dict=1)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/”, line 132, in sql
self._cursor.execute(query, values)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
ProgrammingError: (1064, “You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘.expense_account, pi_item.qty, pi_item.base_net_rate, pi_item.base_net_amount, p’ at line 4”)

Pushed the fix

@nabinhait, run bench update?

I’m using v5…