Im trying to open a doctype i just created it keeps on giving me that error, can someone help

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 55, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 957, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/load.py", line 71, in getdoctype
    docs = get_meta_bundle(doctype)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/load.py", line 81, 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 24, in get_meta
    meta = FormMeta(doctype)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/meta.py", line 34, in __init__
    self.load_assets()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/meta.py", line 41, in load_assets
    self.add_code()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/meta.py", line 68, 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 147, in get_module_path
    return frappe.get_module_path(module)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 749, in get_module_path
    return get_pymodule_path(local.module_app[module] + "." + module, *joins)
KeyError: u'sales'

Sales Module is probably missing.

Have you renamed any Module from Module Def

i created a module def and named it sales, and under that module when i try to open doctypes that are in it thats when the error pops up

Go to DocType, open that new doctype you created and check what is the value of Module. If it is not Sales then it is the problem.

solved it, thnkx

so what was the issue and how did you solve it ?