ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

Server Error KeyError: 'sales'

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 59, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 24, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 64, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1075, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/load.py”, line 70, in getdoctype
docs = get_meta_bundle(doctype)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/load.py”, line 80, in get_meta_bundle
bundle = [frappe.desk.form.meta.get_meta(doctype)]
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/meta.py”, line 26, in get_meta
meta = FormMeta(doctype)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/meta.py”, line 39, in init
self.load_assets()
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/meta.py”, line 49, in load_assets
self.add_code()
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/meta.py”, line 81, in add_code
path = os.path.join(get_module_path(self.module), ‘doctype’, scrub(self.name))
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 166, in get_module_path
return frappe.get_module_path(module)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 856, in get_module_path
return get_pymodule_path(local.module_app[module] + “.” + module, *joins)
KeyError: ‘sales’

ERPNext: v12.22.0 (version-12)

Frappe Framework: v12.19.2 (version-12)

The error just started appearing when one of the users was trying to create customer
What does this error mean and how can I resolve it?

any help on this please

Getting the same. Were you able to solve it?

Hi, I was able to solve it.

  1. Took a backup of the site.
  2. Ran bench --site site-name reinstall
  3. Restored the backup

after restore it remained same…

Here is how i got this issue fixed

  1. Searched for ‘Module Def’ to open “Module Def List”
  2. Entered “Sales”
  3. Renamed sales to Selling
  4. Saved
1 Like