"printing" a sales invoice from a server-side script

Seems like your lib repo is outdated.

Try after updating using lib/wnf.py --update origin 1310 (assuming you are still in 1310 branch).


On 21-Nov-2013, at 2:53 PM, Jonathan wrote:


I should have thought of that. Here is the output from the console.  Any further suggestions?

Thanks.

- j

-------------------------------------------

Traceback (innermost last): File "../lib/webnotes/widgets/form/save.py", line 17, in savedocs getattr(wrapper, action.lower())() File "../lib/webnotes/model/bean.py", line 348, in submit self.run_method('on_submit') File "../lib/webnotes/model/bean.py", line 229, in run_method getattr(self.controller, method)() File "../app/accounts/doctype/sales_invoice/sales_invoice.py", line 97, in on_submit self.make_gl_entries() File "../app/accounts/doctype/sales_invoice/sales_invoice.py", line 546, in make_gl_entries update_outstanding=update_outstanding, merge_entries=False) File "../app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "../app/accounts/general_ledger.py", line 71, in save_entries make_entry(entry, adv_adj, update_outstanding) File "../app/accounts/general_ledger.py", line 87, in make_entry gle.run_method("on_update_with_args", adv_adj, update_outstanding) TypeError: run_method() takes exactly 2 arguments (4 given)


Traceback (innermost last): File "../lib/webnotes/handler.py", line 91, in handle execute_cmd(cmd) File "../lib/webnotes/handler.py", line 131, in execute_cmd ret = call(method, webnotes.form_dict) File "../lib/webnotes/handler.py", line 148, in call return fn(**newargs) File "../lib/webnotes/widgets/form/save.py", line 26, in savedocs raise e TypeError: run_method() takes exactly 2 arguments (4 given)




Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

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



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

    For more options, visit https://groups.google.com/groups/opt_out.
Thanks.  Normal submit is now working again.
 
And back to the original topic, I am also now getting good html again from webnotes.webutils.render_page("print").  But I am calling render_page from a custom script which triggers on submit, and the render_page() call takes a long time to execute.  So after the render_page comes back, I get a lock wait timeout error (stack trace below), and the submit fails.

Any suggestions? Is the lock timeout a setting I can change? Do I need to run this function as a separate thread?

Thanks.

- j

 
Traceback (innermost last):
  File "../lib/webnotes/widgets/form/save.py", line 17, in savedocs
    getattr(wrapper, action.lower())()
  File "../lib/webnotes/model/bean.py", line 348, in submit
    self.run_method('on_submit')
  File "../lib/webnotes/model/bean.py", line 233, in run_method
    notify(self.controller, method)
  File "../lib/webnotes/model/bean.py", line 471, in notify
    call_observers("*:" + caller_method)
  File "../lib/webnotes/model/bean.py", line 467, in call_observers
    webnotes.get_method(observer_method)(controller, caller_method)
  File "../app/home/__init__.py", line 91, in update_feed
    make_feed('', doc.doctype, doc.name, doc.owner, subject % doc.fields, color)
  File "../app/home/__init__.py", line 73, in make_feed
    and ifnull(feed_type,'') != 'Comment'""", (doctype, name))
  File "../lib/webnotes/db.py", line 111, in sql
    raise e
 OperationalError: (1205, 'Lock wait timeout exceeded; try restarting transaction')
 
 Traceback (innermost last):
  File "../lib/webnotes/handler.py", line 93, in handle
    execute_cmd(cmd)
  File "../lib/webnotes/handler.py", line 133, in execute_cmd
    ret = call(method, webnotes.form_dict)
  File "../lib/webnotes/handler.py", line 150, in call
    return fn(**newargs)
  File "../lib/webnotes/widgets/form/save.py", line 26, in savedocs
    raise e
 OperationalError: (1205, 'Lock wait timeout exceeded; try restarting transaction')



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

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

Hi Jonathan,

I don’t think it is possible right now to execute print on_submit. Since, during on_submit, the current thread is not committed and the print page of server side calls using another request and has to wait till the current transaction is committed. So it leads to deadlock!

So in your case, you should call print function after the first transaction is completed, in a separated request.

Best,
Anand Doshi.

On 21 November 2013 at 4:44:16 pm, Jonathan (ir...@gmail.com) wrote:

Thanks. Normal submit is now working again.

And back to the original topic, I am also now getting good html again
from webnotes.webutils.render_page(“print”). But I am calling render_page
from a custom script which triggers on submit, and the render_page() call
takes a long time to execute. So after the render_page comes back, I get a
lock wait timeout error (stack trace below), and the submit fails.

Any suggestions? Is the lock timeout a setting I can change? Do I need to
run this function as a separate thread?

Thanks.

  • j

Traceback (innermost last):
File “…/lib/webnotes/widgets/form/save.py”, line 17, in savedocs
getattr(wrapper, action.lower())()
File “…/lib/webnotes/model/bean.py”, line 348, in submit
self.run_method(‘on_submit’)
File “…/lib/webnotes/model/bean.py”, line 233, in run_method
notify(self.controller, method)
File “…/lib/webnotes/model/bean.py”, line 471, in notify
call_observers(“*:” + caller_method)
File “…/lib/webnotes/model/bean.py”, line 467, in call_observers
webnotes.get_method(observer_method)(controller, caller_method)
File “…/app/home/init.py”, line 91, in update_feed
make_feed(‘’, doc.doctype, doc.name, doc.owner, subject % doc.fields,
color)
File “…/app/home/init.py”, line 73, in make_feed
and ifnull(feed_type,‘’) != ‘Comment’“”", (doctype, name))
File “…/lib/webnotes/db.py”, line 111, in sql
raise e
OperationalError: (1205, ‘Lock wait timeout exceeded; try restarting
transaction’)

Traceback (innermost last):
File “…/lib/webnotes/handler.py”, line 93, in handle
execute_cmd(cmd)
File “…/lib/webnotes/handler.py”, line 133, in execute_cmd
ret = call(method, webnotes.form_dict)
File “…/lib/webnotes/handler.py”, line 150, in call
return fn(**newargs)
File “…/lib/webnotes/widgets/form/save.py”, line 26, in savedocs
raise e
OperationalError: (1205, ‘Lock wait timeout exceeded; try restarting
transaction’)


Note:

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.
For more options, visit https://groups.google.com/groups/opt_out.


Note:

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.
For more options, visit https://groups.google.com/groups/opt_out.

Hello Anand,

thanks a lot for your help and support with our customisations.
We have a problem after updating to branch 1310: I can not access any pricelist. I can see all pricelsist in selling module, but when I click on one to update a price, I get the 404 error.

Do you have any clue?

Best,

Amin from fritzing

On Thursday, November 21, 2013 2:36:25 PM UTC+1, Anand Doshi wrote:
Hi Jonathan,

I don’t think it is possible right now to execute print on_submit. Since, during on_submit, the current thread is not committed and the print page of server side calls using another request and has to wait till the current transaction is committed. So it leads to deadlock!

So in your case, you should call print function after the first transaction is completed, in a separated request.

Best,
Anand Doshi.

On 21 November 2013 at 4:44:16 pm, Jonathan (ir...@gmail.com) wrote:
>
>
>>
>> Thanks. Normal submit is now working again.
>>
>
>
>> And back to the original topic, I am also now getting good html again
>> from webnotes.webutils.render_page("print"). But I am calling render_page
>> from a custom script which triggers on submit, and the render_page() call
>> takes a long time to execute. So after the render_page comes back, I get a
>> lock wait timeout error (stack trace below), and the submit fails.
>>
>
>Any suggestions? Is the lock timeout a setting I can change? Do I need to
>run this function as a separate thread?
>
>Thanks.
>
>- j
>
>
>Traceback (innermost last):
>File "../lib/webnotes/widgets/form/save.py", line 17, in savedocs
>getattr(wrapper, action.lower())()
>File "../lib/webnotes/model/bean.py", line 348, in submit
>self.run_method('on_submit')
>File "../lib/webnotes/model/bean.py", line 233, in run_method
>notify(self.controller, method)
>File "../lib/webnotes/model/bean.py", line 471, in notify
>call_observers("*:" + caller_method)
>File "../lib/webnotes/model/bean.py", line 467, in call_observers
>webnotes.get_method(observer_method)(controller, caller_method)
>File "../app/home/__init__.py", line 91, in update_feed
>make_feed('', doc.doctype, doc.name, doc.owner, subject % doc.fields,
>color)
>File "../app/home/__init__.py", line 73, in make_feed
>and ifnull(feed_type,'') != 'Comment'""", (doctype, name))
>File "../lib/webnotes/db.py", line 111, in sql
>raise e
>OperationalError: (1205, 'Lock wait timeout exceeded; try restarting
>transaction')
>
>Traceback (innermost last):
>File "../lib/webnotes/handler.py", line 93, in handle
>execute_cmd(cmd)
>File "../lib/webnotes/handler.py", line 133, in execute_cmd
>ret = call(method, webnotes.form_dict)
>File "../lib/webnotes/handler.py", line 150, in call
>return fn(**newargs)
>File "../lib/webnotes/widgets/form/save.py", line 26, in savedocs
>raise e
>OperationalError: (1205, 'Lock wait timeout exceeded; try restarting
>transaction')
>
>--
>Note:
>
>If you are posting an issue,
>1. 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.
>2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
>3. 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.
>For more options, visit https://groups.google.com/groups/opt_out.
>



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

    For more options, visit https://groups.google.com/groups/opt_out.
Hi Amin,

Can you check if there is any error in the console?

It looks like a permission issue.
Check if the user has at least read permission on Item Price and Price List.

Best,
Anand.


On Wed, Nov 27, 2013 at 10:35 PM, Amin Zayani <za...@gmail.com> wrote:
Hello Anand,

thanks a lot for your help and support with our customisations.

We have a problem after updating to branch 1310: I can not access any pricelist. I can see all pricelsist in selling module, but when I click on one to update a price, I get the 404 error.


Do you have any clue?


Best,

Amin from fritzing


On Thursday, November 21, 2013 2:36:25 PM UTC+1, Anand Doshi wrote:
Hi Jonathan,

I don’t think it is possible right now to execute print on_submit. Since, during on_submit, the current thread is not committed and the print page of server side calls using another request and has to wait till the current transaction is committed. So it leads to deadlock!

So in your case, you should call print function after the first transaction is completed, in a separated request.

Best,
Anand Doshi.

On 21 November 2013 at 4:44:16 pm, Jonathan (ir...@gmail.com) wrote:
>
>
>>
>> Thanks. Normal submit is now working again.
>>
>
>
>> And back to the original topic, I am also now getting good html again
>> from webnotes.webutils.render_page("print"). But I am calling render_page
>> from a custom script which triggers on submit, and the render_page() call
>> takes a long time to execute. So after the render_page comes back, I get a
>> lock wait timeout error (stack trace below), and the submit fails.
>>
>
>Any suggestions? Is the lock timeout a setting I can change? Do I need to
>run this function as a separate thread?
>
>Thanks.
>
>- j
>
>
>Traceback (innermost last):
>File "../lib/webnotes/widgets/form/save.py", line 17, in savedocs
>getattr(wrapper, action.lower())()
>File "../lib/webnotes/model/bean.py", line 348, in submit
>self.run_method('on_submit')
>File "../lib/webnotes/model/bean.py", line 233, in run_method
>notify(self.controller, method)
>File "../lib/webnotes/model/bean.py", line 471, in notify
>call_observers("*:" + caller_method)
>File "../lib/webnotes/model/bean.py", line 467, in call_observers
>webnotes.get_method(observer_method)(controller, caller_method)
>File "../app/home/__init__.py", line 91, in update_feed
>make_feed('', doc.doctype, doc.name, doc.owner, subject % doc.fields,
>color)
>File "../app/home/__init__.py", line 73, in make_feed
>and ifnull(feed_type,'') != 'Comment'""", (doctype, name))
>File "../lib/webnotes/db.py", line 111, in sql
>raise e
>OperationalError: (1205, 'Lock wait timeout exceeded; try restarting
>transaction')
>
>Traceback (innermost last):
>File "../lib/webnotes/handler.py", line 93, in handle
>execute_cmd(cmd)
>File "../lib/webnotes/handler.py", line 133, in execute_cmd
>ret = call(method, webnotes.form_dict)
>File "../lib/webnotes/handler.py", line 150, in call
>return fn(**newargs)
>File "../lib/webnotes/widgets/form/save.py", line 26, in savedocs
>raise e
>OperationalError: (1205, 'Lock wait timeout exceeded; try restarting
>transaction')
>
>--
>Note:
>
>If you are posting an issue,
>1. 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.
>2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
>3. 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.
>For more options, visit https://groups.google.com/groups/opt_out.
>



Note:



If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

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




Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

    For more options, visit https://groups.google.com/groups/opt_out.
Hi Anand,

Here is the javascript console output when I click on any price list doc (As Amin said, the list is correct). I am logged in as admin:

- j

Traceback (innermost last): File "../lib/webnotes/widgets/form/load.py", line 30, in getdoc bean.run_method("onload") File "../lib/webnotes/model/bean.py", line 226, in run_method self.make_controller() File "../lib/webnotes/model/bean.py", line 97, in make_controller self.obj = webnotes.get_obj(doc=self.doc, doclist=self.doclist) File "../lib/webnotes/__init__.py", line 319, in get_obj return get_obj(dt, dn, doc, doclist, with_children) File "../lib/webnotes/model/code.py", line 143, in get_obj return get_server_obj(doc, doclist) File "../lib/webnotes/model/code.py", line 82, in get_server_obj DocType = get_doctype_class(doc.doctype, module) File "../lib/webnotes/model/code.py", line 105, in get_doctype_class raise ImportError, "Unable to load module for: " + doctype ImportError: Unable to load module for: Price List all-app.min.js:241
Traceback (innermost last): File "../lib/webnotes/handler.py", line 93, in handle execute_cmd(cmd) File "../lib/webnotes/handler.py", line 133, in execute_cmd ret = call(method, webnotes.form_dict) File "../lib/webnotes/handler.py", line 150, in call return fn(**newargs) File "../lib/webnotes/widgets/form/load.py", line 40, in getdoc raise e ImportError: Unable to load module for: Price List



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

    For more options, visit https://groups.google.com/groups/opt_out.
Hi Jonathan,

It looks like there is some kind of import issue in price_list.py.

If you haven't done any customization, you should reset your repository and get the latest update.

Or, you will have to find out what is causing the issue - it might be some syntax error or an incorrect import statement in price_list.py

It can also be due to pyc files.

On which branch is your repo? What are the last commits in both app and lib repo (use git log)?

Best,
Anand.


On Thu, Nov 28, 2013 at 4:08 PM, Jonathan <ir…@gmail.com> wrote:

Hi Anand,

Here is the javascript console output when I click on any price list doc (As Amin said, the list is correct). I am logged in as admin:

- j

Traceback (innermost last):
File "…/lib/webnotes/widgets/form/load.py", line 30, in getdoc
bean.run_method("onload")
File "…/lib/webnotes/model/bean.py", line 226, in run_method
self.make_controller()
File "…/lib/webnotes/model/bean.py", line 97, in make_controller
self.obj = webnotes.get_obj(doc=self.doc, doclist=self.doclist)
File "…/lib/webnotes/init.py", line 319, in get_obj
return get_obj(dt, dn, doc, doclist, with_children)
File "…/lib/webnotes/model/code.py", line 143, in get_obj
return get_server_obj(doc, doclist)
File "…/lib/webnotes/model/code.py", line 82, in get_server_obj
DocType = get_doctype_class(doc.doctype, module)
File "…/lib/webnotes/model/code.py", line 105, in get_doctype_class
raise ImportError, "Unable to load module for: " + doctype
ImportError: Unable to load module for: Price List
all-app.min.js:241

Traceback (innermost last):
File "…/lib/webnotes/handler.py", line 93, in handle
execute_cmd(cmd)
File "…/lib/webnotes/handler.py", line 133, in execute_cmd
ret = call(method, webnotes.form_dict)
File "…/lib/webnotes/handler.py", line 150, in call
return fn(**newargs)
File "…/lib/webnotes/widgets/form/load.py", line 40, in getdoc
raise e
ImportError: Unable to load module for: Price List



Note:



If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

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




Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

    For more options, visit https://groups.google.com/groups/opt_out.
Hi.  

Now I have an even worse problem. Please follow the output below. 

Thanks.

- j

----------------------------

git branch

1310

git log

commit a07a5084c14dd9861edc3f279013884c1437a4b3
Author: Nabin Hait <>
Date:   Wed Nov 27 12:05:32 2013 +0530

    Update payment_made_with_ageing.py

commit a9671009908d0915e93a3062d37c0c63aa654d71
Author: Nabin Hait <>
Date:   Wed Nov 27 12:05:15 2013 +0530

    Update payment_collection_with_ageing.py

commit 9f51ee4a84b1d812a5dac2503608c5a5483fd21e
Author: Nabin Hait <>
Date:   Sun Nov 24 16:03:40 2013 +0530

    [fix] [minor] serial no status update fix

lib/wnf.py --update origin 1310

From git://github.com/webnotes/wnframework
 * branch            1310       -> FETCH_HEAD
Already up-to-date.
From git://github.com/webnotes/erpnext
 * branch            1310       -> FETCH_HEAD
Already up-to-date.
Traceback (most recent call last):
  File "lib/wnf.py", line 590, in <module>
    run()
  File "lib/wnf.py", line 466, in run
    patch_sync_build()
  File "lib/wnf.py", line 81, in patch_sync_build
    patch_sync()
  File "lib/wnf.py", line 92, in patch_sync
    sync_all()
  File "lib/wnf.py", line 73, in sync_all
    webnotes.model.sync.sync_all(force)
  File "/var/www/erpnext/lib/webnotes/model/sync.py", line 17, in sync_all
    sync_for("app", force)
  File "/var/www/erpnext/lib/webnotes/model/sync.py", line 22, in sync_for
    folder), force, sync_everything)
  File "/var/www/erpnext/lib/webnotes/model/sync.py", line 46, in walk_and_sync
    if import_file(module_name, doctype, name, force):
  File "/var/www/erpnext/lib/webnotes/modules/import_file.py", line 25, in impor            t_file
    ret = import_file_by_path(path, force)
  File "/var/www/erpnext/lib/webnotes/modules/import_file.py", line 46, in impor            t_file_by_path
    import_doclist(doclist)
  File "/var/www/erpnext/lib/webnotes/modules/import_file.py", line 96, in impor            t_doclist
    new_bean.insert()
  File "/var/www/erpnext/lib/webnotes/model/bean.py", line 289, in insert
    return self.save()
  File "/var/www/erpnext/lib/webnotes/model/bean.py", line 333, in save
    self.run_method('on_update')
  File "/var/www/erpnext/lib/webnotes/model/bean.py", line 229, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "/var/www/erpnext/lib/core/doctype/doctype/doctype.py", line 75, in on_up            date
    updatedb(self.doc.name)
  File "/var/www/erpnext/lib/webnotes/model/db_schema.py", line 407, in updatedb
    tab.sync()
  File "/var/www/erpnext/lib/webnotes/model/db_schema.py", line 172, in sync
    self.alter()
  File "/var/www/erpnext/lib/webnotes/model/db_schema.py", line 197, in alter
    webnotes.conn.sql("alter table `%s` alter column `%s` set default %s" % (sel            f.name, col.fieldname, '%s'), (col.default,))
  File "/var/www/erpnext/lib/webnotes/db.py", line 111, in sql
    raise e
_mysql_exceptions.OperationalError: (1067, "Invalid default value for 'send_invo            ice_by_mail'")




Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

    For more options, visit https://groups.google.com/groups/opt_out.
I think I see what's causing the problem. We have a custom field called send_invoice_by_mail which is a checkbox. In the mysql tabSales Invoice table this is defined as

`send_invoice_by_mail` int(1) DEFAULT NULL,

Which is causing the crash.

I will try to fix the database locally, but I think the default null may be an erpnext issue.



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

    For more options, visit https://groups.google.com/groups/opt_out.
I set all the nulls in the table to 0, and altered the table definition so that the default for 'send_invoice_by_mail' is 0. However, the error from lib/wnf.py --update origin 1310 is still the same. Any suggestions?

- j




Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

    For more options, visit https://groups.google.com/groups/opt_out.
Jonathan,

Try changing the default value in the Custom Field and save.

-Anand.


On Fri, Nov 29, 2013 at 4:54 PM, Jonathan <ir...@gmail.com> wrote:
I set all the nulls in the table to 0, and altered the table definition so that the default for 'send_invoice_by_mail' is 0. However, the error from lib/wnf.py --update origin 1310 is still the same. Any suggestions?


- j




Note:



If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

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




Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

    For more options, visit https://groups.google.com/groups/opt_out.
The default value is set to 'Yes'. As I recall, we tried setting the default to 'True' (with various spellings) and to '1', but this was the only non-zero default we could get it to accept.



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

    For more options, visit https://groups.google.com/groups/opt_out.
1 should work if the field type is Check. Put it without a string. Just enter 1. 

Sent from phone

On 30-Nov-2013, at 11:21 am, Jonathan <ir...@gmail.com> wrote:

The default value is set to 'Yes'. As I recall, we tried setting the default to 'True' (with various spellings) and to '1', but this was the only non-zero default we could get it to accept.



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

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



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

    For more options, visit https://groups.google.com/groups/opt_out.
Dear ERPNext,

we have a problem with this server side script (the very origin of this forum post. It used to work, on a master branch from september, then we updated to another master and it didn't work anymore, so you made branch 1310, which made it work, but broke a million other things. Now we are on the latest master, we have no probklems anympre, but we need that server side script to work again.

We would be so grateful if you could tell us to which master we need to downgrade to get the server side script to work without anything else being broken.

Thanks

The fritzing team

On Saturday, November 30, 2013 7:13:07 AM UTC+1, Anand Doshi wrote:
1 should work if the field type is Check. Put it without a string. Just enter 1. 

Sent from phone

On 30-Nov-2013, at 11:21 am, Jonathan <ir...@gmail.com> wrote:

The default value is set to 'Yes'. As I recall, we tried setting the default to 'True' (with various spellings) and to '1', but this was the only non-zero default we could get it to accept.



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

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



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

    For more options, visit https://groups.google.com/groups/opt_out.
Hi Amin,

This thread is too long and we have lost perspective of what exactly is the problem. Can you consolidate the problem areas?

From the thread, I can see that Jonathan was stuck at an invalid default value for a Check custom field. But check field can have 1 or 0 as default value but not Yes. So it was a problem at your end, which with my previous answer, should've been rectified.

So, is the issue with printing separate from the previous message in this thread? 

Please also post error messages from console or network tab responses, as it will help with the debugging.

Thanks,
Anand.

On Monday, December 9, 2013 10:46:02 PM UTC+5:30, Amin Zayani wrote:
Dear ERPNext,

we have a problem with this server side script (the very origin of this forum post. It used to work, on a master branch from september, then we updated to another master and it didn't work anymore, so you made branch 1310, which made it work, but broke a million other things. Now we are on the latest master, we have no probklems anympre, but we need that server side script to work again.

We would be so grateful if you could tell us to which master we need to downgrade to get the server side script to work without anything else being broken.

Thanks

The fritzing team

On Saturday, November 30, 2013 7:13:07 AM UTC+1, Anand Doshi wrote:
1 should work if the field type is Check. Put it without a string. Just enter 1. 

Sent from phone

On 30-Nov-2013, at 11:21 am, Jonathan <ir...@gmail.com> wrote:

The default value is set to 'Yes'. As I recall, we tried setting the default to 'True' (with various spellings) and to '1', but this was the only non-zero default we could get it to accept.



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

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



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

    For more options, visit https://groups.google.com/groups/opt_out.
Hi Anand,

We we are is the following. The invoice "printing" script now works in branch 1310, but does not work in the master branch. This is because the heart of the "print" script is a call to render_page(), and render_page() is no longer working in the master branch (see the message from Nov 1). Unfortunately the 1310 branch breaks other functionality in our installation, so we have had to return to the master branch.

What we would like is to either

1) go back to a master branch in which render_page is working
2) go forward to a new master branch in which render_page is working.

I hope that is clear.

Thanks,

- j



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

    For more options, visit https://groups.google.com/groups/opt_out.
Hi Jonathan,

It could be because the web page rendering functions have changed. But server side printing still works.

Login to demo.erpnext.com and see the url:

Have you done any customizations in these functions? What kind of error are you getting?
Without error traces, it is difficult to pinpoint the problem.

It could also be that you don't have the latest master!

Thanks,
Anand.


On Wed, Dec 11, 2013 at 8:29 PM, Jonathan <ir...@gmail.com> wrote:
Hi Anand,

We we are is the following. The invoice "printing" script now works in branch 1310, but does not work in the master branch. This is because the heart of the "print" script is a call to render_page(), and render_page() is no longer working in the master branch (see the message from Nov 1). Unfortunately the 1310 branch breaks other functionality in our installation, so we have had to return to the master branch.

What we would like is to either

1) go back to a master branch in which render_page is working
2) go forward to a new master branch in which render_page is working.

I hope that is clear.

Thanks,

- j



Note:



If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

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




Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

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