Something went wrong when clicked in Item Code box to type

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 62, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 22, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 53, in execute_cmd
return, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 939, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/”, line 51, in search_link
search_widget(doctype, txt, query, searchfield=searchfield, page_length=page_length, filters=filters)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/”, line 73, in search_widget
searchfield, start, page_length, filters, as_dict=as_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 939, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/”, line 156, in item_query
if frappe.db.count(‘Item’, cache=True) < 50000:
TypeError: count() got an unexpected keyword argument ‘cache’

Hi welcome and ERPNext,

That code was added in April, 2018 [optimize] item queries by rmehta · Pull Request #13480 · frappe/erpnext · GitHub

and ‘cache’ is a legal optional argument

What is your frappe and erpnext version?

Are you in a self-hosted environment, if yes a code recompile might fix this? Run ‘bench console’ then run this:

frappe-bench > cd apps/frappe
frappe-bench/apps/frappe > find . -name "*.pyc" | xargs rm -f
1 Like