Doctype save error

Hello, I've followed this tutorial https://github.com/frappe/bench, and when I try to save a Doctype I get an error message. The Doctype gets saved into the db because if I try to save again with the same name I get that an error saying that it was saved. The problem is that when I try to add a new record to the Doctype I get this error https://groups.google.com/forum/#!topic/erpnext-developer-forum/vkRhMeW5ZNg, but I'm guessing that the record error is because of the Doctype error. Also I've checked  the directory and the file does exist. I also gave chmod 777 to everything to see if it was a problem with permission, but no.
2014-08-15 23:24:43,748 Request Error 
 site: library
 form: {'action': u'Save',
 'cmd': u'frappe.widgets.form.save.savedocs',
 'doc': u'{"docstatus":0,"doctype":"DocType","name":"New DocType 3","__islocal":1,"__unsaved":1,"owner":"Administrator","document_type":"","name_case":"","sort_field":"modified","sort_order":"DESC","module":"Library Management","fields":[{"docstatus":0,"doctype":"DocField","name":"New DocField 3","__islocal":1,"__unsaved":1,"owner":"Administrator","fieldtype":"Data","permlevel":0,"parent":"New DocType 3","parentfield":"fields","parenttype":"DocType","idx":1,"label":"Name","reqd":1}],"permissions":[{"docstatus":0,"doctype":"DocPerm","name":"New DocPerm 3","__islocal":1,"__unsaved":1,"owner":"Administrator","permlevel":0,"parent":"New DocType 3","parentfield":"permissions","parenttype":"DocType","idx":1,"role":"Library Member","read":1,"write":1,"create":1,"delete":1}],"server_code_compiled":null,"__newname":"Articles"}'}

Traceback (innermost last):
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/app.py", line 49, in application
    response = frappe.handler.handle()
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/handler.py", line 66, in handle
    execute_cmd(cmd)
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/handler.py", line 89, in execute_cmd
    ret = frappe.call(method, **frappe.form_dict)
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/__init__.py", line 526, in call
    return fn(*args, **newargs)
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/widgets/form/save.py", line 18, in savedocs
    doc.save()
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 163, in save
    self.insert()
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 153, in insert
    self.run_post_save_methods()
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 427, in run_post_save_methods
    self.run_method("on_update")
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 400, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 478, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 461, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 394, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 95, in on_update
    self.make_controller_template()
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 149, in make_controller_template
    make_boilerplate("controller.py", self)
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/modules/__init__.py", line 92, in make_boilerplate
    "boilerplate", template), 'r') as source:
 IOError: [Errno 2] No such file or directory: u'/home/vagrant/frappe-bench/apps/frappe/frappe/core/doctype/DocType/boilerplate/controller.py'

Any ideas?



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/e00ccae3-7455-4092-903b-f429e2c60d27%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Gerardo,

Seems like there is something wrong in the setup. Did you make any local changes in the frappe code?



On 16-Aug-2014, at 5:02 am, Gerardo Rendon <ge...@gmail.com> wrote:

Hello, I've followed this tutorial https://github.com/frappe/bench, and when I try to save a Doctype I get an error message. The Doctype gets saved into the db because if I try to save again with the same name I get that an error saying that it was saved. The problem is that when I try to add a new record to the Doctype I get this error https://groups.google.com/forum/#!topic/erpnext-developer-forum/vkRhMeW5ZNg, but I'm guessing that the record error is because of the Doctype error. Also I've checked  the directory and the file does exist. I also gave chmod 777 to everything to see if it was a problem with permission, but no.
2014-08-15 23:24:43,748 Request Error 
 site: library
 form: {'action': u'Save',
 'cmd': u'frappe.widgets.form.save.savedocs',
 'doc': u'{"docstatus":0,"doctype":"DocType","name":"New DocType 3","__islocal":1,"__unsaved":1,"owner":"Administrator","document_type":"","name_case":"","sort_field":"modified","sort_order":"DESC","module":"Library Management","fields":[{"docstatus":0,"doctype":"DocField","name":"New DocField 3","__islocal":1,"__unsaved":1,"owner":"Administrator","fieldtype":"Data","permlevel":0,"parent":"New DocType 3","parentfield":"fields","parenttype":"DocType","idx":1,"label":"Name","reqd":1}],"permissions":[{"docstatus":0,"doctype":"DocPerm","name":"New DocPerm 3","__islocal":1,"__unsaved":1,"owner":"Administrator","permlevel":0,"parent":"New DocType 3","parentfield":"permissions","parenttype":"DocType","idx":1,"role":"Library Member","read":1,"write":1,"create":1,"delete":1}],"server_code_compiled":null,"__newname":"Articles"}'}

Traceback (innermost last):
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/app.py", line 49, in application
    response = frappe.handler.handle()
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/handler.py", line 66, in handle
    execute_cmd(cmd)
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/handler.py", line 89, in execute_cmd
    ret = frappe.call(method, **frappe.form_dict)
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/__init__.py", line 526, in call
    return fn(*args, **newargs)
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/widgets/form/save.py", line 18, in savedocs
    doc.save()
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 163, in save
    self.insert()
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 153, in insert
    self.run_post_save_methods()
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 427, in run_post_save_methods
    self.run_method("on_update")
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 400, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 478, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 461, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 394, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 95, in on_update
    self.make_controller_template()
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 149, in make_controller_template
    make_boilerplate("controller.py", self)
  File "/home/vagrant/frappe-bench/apps/frappe/frappe/modules/__init__.py", line 92, in make_boilerplate
    "boilerplate", template), 'r') as source:
 IOError: [Errno 2] No such file or directory: u'/home/vagrant/frappe-bench/apps/frappe/frappe/core/doctype/DocType/boilerplate/controller.py'

Any ideas?




Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/e00ccae3-7455-4092-903b-f429e2c60d27%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/C60134A0-7BC6-4A0B-BB8F-D31288FE2353%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.
Hi Gerardo.

This was a bug! Thanks for reporting it. Please update and it should start working.

Thanks,
Anand.


On Sat, Aug 16, 2014 at 5:36 PM, Rushabh Mehta <rm...@gmail.com> wrote:
Gerardo,

Seems like there is something wrong in the setup. Did you make any local changes in the frappe code?




On 16-Aug-2014, at 5:02 am, Gerardo Rendon <ge…@gmail.com> wrote:

Hello, I've followed this tutorial https://github.com/frappe/bench, and when I try to save a Doctype I get an error message. The Doctype gets saved into the db because if I try to save again with the same name I get that an error saying that it was saved. The problem is that when I try to add a new record to the Doctype I get this error https://groups.google.com/forum/#!topic/erpnext-developer-forum/vkRhMeW5ZNg, but I'm guessing that the record error is because of the Doctype error. Also I've checked the directory and the file does exist. I also gave chmod 777 to everything to see if it was a problem with permission, but no.

2014-08-15 23:24:43,748 Request Error
site: library
form: {'action': u'Save',
'cmd': u'frappe.widgets.form.save.savedocs',
'doc': u'{"docstatus":0,"doctype":"DocType","name":"New DocType 3","__islocal":1,"__unsaved":1,"owner":"Administrator","document_type":"","name_case":"","sort_field":"modified","sort_order":"DESC","module":"Library Management","fields":[{"docstatus":0,"doctype":"DocField","name":"New DocField 3","__islocal":1,"__unsaved":1,"owner":"Administrator","fieldtype":"Data","permlevel":0,"parent":"New DocType 3","parentfield":"fields","parenttype":"DocType","idx":1,"label":"Name","reqd":1}],"permissions":[{"docstatus":0,"doctype":"DocPerm","name":"New DocPerm 3","__islocal":1,"__unsaved":1,"owner":"Administrator","permlevel":0,"parent":"New DocType 3","parentfield":"permissions","parenttype":"DocType","idx":1,"role":"Library Member","read":1,"write":1,"create":1,"delete":1}],"server_code_compiled":null,"__newname":"Articles"}'}

Traceback (innermost last):
File "/home/vagrant/frappe-bench/apps/frappe/frappe/app.py", line 49, in application
response = frappe.handler.handle()
File "/home/vagrant/frappe-bench/apps/frappe/frappe/handler.py", line 66, in handle
execute_cmd(cmd)
File "/home/vagrant/frappe-bench/apps/frappe/frappe/handler.py", line 89, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File "/home/vagrant/frappe-bench/apps/frappe/frappe/__init__.py", line 526, in call
return fn(*args, **newargs)
File "/home/vagrant/frappe-bench/apps/frappe/frappe/widgets/form/save.py", line 18, in savedocs
doc.save()
File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 163, in save
self.insert()
File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 153, in insert
self.run_post_save_methods()
File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 427, in run_post_save_methods
self.run_method("on_update")
File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 400, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 478, in composer
return composed(self, method, *args, **kwargs)
File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 461, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/vagrant/frappe-bench/apps/frappe/frappe/model/document.py", line 394, in <lambda>
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/vagrant/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 95, in on_update
self.make_controller_template()
File "/home/vagrant/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 149, in make_controller_template
make_boilerplate("controller.py", self)
File "/home/vagrant/frappe-bench/apps/frappe/frappe/modules/__init__.py", line 92, in make_boilerplate
"boilerplate", template), 'r') as source:
IOError: [Errno 2] No such file or directory: u'/home/vagrant/frappe-bench/apps/frappe/frappe/core/doctype/DocType/boilerplate/controller.py'

Any ideas?




Note:



If you are posting an issue,


  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.

  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.

  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email

  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.



    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/e00ccae3-7455-4092-903b-f429e2c60d27%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.




Note:



If you are posting an issue,


  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.

  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.

  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email

  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.



    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/C60134A0-7BC6-4A0B-BB8F-D31288FE2353%40gmail.com.

For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAAQzbF0B_wgnXROqJ%3DU9JrTBpGGp_-ShujO7i0fO7kUCQJJNyA%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.