Something went wrong when clicked in Item Code box to type

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 939, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/search.py”, 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/search.py”, line 73, in search_widget
searchfield, start, page_length, filters, as_dict=as_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 939, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/queries.py”, 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