1

I have created a new module named PhotoGalleryfrom Module Def List-> New . Then i have created a new doctype named photoAlbum for this module from DoctypeList->new. Then in desktop the new module is shown , i opened the module and got the option document-> photoAlbum . but when i selected the doctype photoAlbum : i got the following error:

Traceback (innermost last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 51, in   application
  response = frappe.handler.handle()
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 69, in handle
 execute_cmd(cmd)
 File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 92, in     execute_cmd
ret = frappe.call(method, **frappe.form_dict)
   File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line  754, in call
return fn(*args, **newargs)
 File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/load.py", line 63, in getdoctype
docs = get_meta_bundle(doctype)
 File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/load.py", line 73, 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 20, in get_meta
meta = frappe.cache().hget("form_meta", doctype, lambda:   FormMeta(doctype))
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py", line 123, in hget
value = generator()
File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/meta.py", line 20, in 
meta = frappe.cache().hget("form_meta", doctype, lambda: FormMeta(doctype))
File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/meta.py", line 32, in __init__
self.load_assets()
    File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/meta.py", line 39, in load_assets
self.add_code()
       File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/meta.py", line 58, 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/__init__.py", line 29, in get_module_path
return frappe.get_module_path(module)
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 583, in get_module_path
return get_pymodule_path(local.module_app[module] + "." + module, *joins)
KeyError: u'photogallery'

Should i have to do some updations after doing these changes or is there anything else iam missing ????

Also after creating the doctype photoAlbum, i used the following commands to know whether the table has been created:

bench mysql
desc `tabphotoAlbum`;

And i got the structure of the table as result .So the table has been created but still getting the error????

Viveka
  • 237
  • 2
  • 4
  • 20

1 Answers1

0

Make sure you are running development setup of frappe bench and not the production setup i.e. you should be using bench start instead of supervisor managed processes. (https://github.com/frappe/bench#running-the-bench)

  • i have now added the code for new module in /home/frappe/frappe-bench/apps/erpnext/erpnext/config/desktop.py this location. and restarted using bench restart command. But i have not made any changes in /home/frappe/frappe-bench/apps/frappe/frappe/config/desktop.py. Is that causing this error??? – Viveka Oct 13 '15 at 05:01
  • ALso after creating a new module when i use bench start option the newly created module is not shown in desktop, instead if i use these commands bench restart supervisorctl reload service nginx reload it works. So maybe that is the problem – Viveka Oct 13 '15 at 09:53
  • i checked the error log and found out that the module was not created properly , it showed permission denied error, so gave all permissions and then created the module again , now it works well – Viveka Oct 21 '15 at 06:09
  • I got it working , actually the module was not properly created in error log got an error as permission denied while creating the module, so gave necessary permissions and created new module successfully – Viveka Oct 27 '15 at 05:30