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

Hi,

Apologies if this question has been previously answered on the forum. 

I would like to "print" a sales invoice from a server-side script.

It is currently possible to "print" a sales invoice using a web API call, for example: http://whereever.erpnext.com/web.py?page=print&doctype=Sales%20Invoice&name=INV-13-14-00027&format=SalesInvoice will return the template-based generated html for the given Sales Invoice.

I would like to trigger this same functionality from within a server-side script, in order to create an email which would include the template-based generated html for the given Sales Invoice. Is the best approach still to use the above HTTP request, or is there an ERPNext python function directly available?

Thank you for 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.
You can use this function

https://github.com/webnotes/wnframework/blob/master/core/doctype/print_format/print_format.py#L63

You will have to set webnotes.form_dict.format and webnotes.form_dict.style to specify the format and style


W: https://erpnext.com
T: @rushabh_mehta

On 18-Sep-2013, at 12:39 PM, Jonathan <ir...@gmail.com> wrote:

Hi,

Apologies if this question has been previously answered on the forum. 

I would like to "print" a sales invoice from a server-side script.

It is currently possible to "print" a sales invoice using a web API call, for example: http://whereever.erpnext.com/web.py?page=print&doctype=Sales%20Invoice&name=INV-13-14-00027&format=SalesInvoice will return the template-based generated html for the given Sales Invoice.

I would like to trigger this same functionality from within a server-side script, in order to create an email which would include the template-based generated html for the given Sales Invoice. Is the best approach still to use the above HTTP request, or is there an ERPNext python function directly available?

Thank you for 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.

Thanks. I am not sure how to invoke the get_html function.  For example, customizing on_update for a Sales Invoice, I have the following code:

  def custom_on_update(self):
    msgprint("got update " + self.doc.name)

    import traceback
    try:
      result = self.get_html(self.doc, self.doclist)
    except:
      tb = traceback.format_exc()
      msgprint(tb)


The first msgprint is shows up, but I get the following exception (visible in the second msgprint) when invoking get_html.

Traceback (most recent call last):
File "", line 33, in custom_on_update
AttributeError: 'CustomDocType' object has no attribute 'get_html'

I have tried other variations such as webnotes.get_html and self.doc.get_html with no success.

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.
You will have to import the method

from wenotes.core.doctype.print_format.print_format import get_html

get_html(self.doc, self.doclist)


W: https://erpnext.com
T: @rushabh_mehta

On 18-Sep-2013, at 7:25 PM, Jonathan <ir...@gmail.com> wrote:


Thanks. I am not sure how to invoke the get_html function.  For example, customizing on_update for a Sales Invoice, I have the following code:

  def custom_on_update(self):
    msgprint("got update " + self.doc.name)

    import traceback
    try:
      result = self.get_html(self.doc, self.doclist)
    except:
      tb = traceback.format_exc()
      msgprint(tb)


The first msgprint is shows up, but I get the following exception (visible in the second msgprint) when invoking get_html.

Traceback (most recent call last):
File "", line 33, in custom_on_update
AttributeError: 'CustomDocType' object has no attribute 'get_html'

I have tried other variations such as webnotes.get_html and self.doc.get_html with no success.

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.

Thanks, that worked.  

I have been setting the following variables:

    webnotes.form_dict.format = "SalesInvoice" 
    webnotes.form_dict.style = "Sales Invoice Classic"

Where the style is the name of a template. However, changing the style to another template, or even commenting out that line, does not seem to change the appearance of the result. Any suggestions?

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.
Style must be one of Modern, Classic or Standard

https://github.com/webnotes/wnframework/tree/master/core/doctype/print_format/styles

If you manage to get this working - please consider writing a small blog post or wiki page on this.

thanks,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta

On 18-Sep-2013, at 9:29 PM, Jonathan <ir...@gmail.com> wrote:


Thanks, that worked.  

I have been setting the following variables:

    webnotes.form_dict.format = "SalesInvoice" 
    webnotes.form_dict.style = "Sales Invoice Classic"

Where the style is the name of a template. However, changing the style to another template, or even commenting out that line, does not seem to change the appearance of the result. Any suggestions?

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.
Hi,

I get a different result (html output) when using the web API approach (http://whatever.erpnext.com/web.py?page=print&doctype=Sales%20Invoice&name=INV-13-14-00027&format=SalesInvoice) vs. the server side script approach. I think this is because the web API approach is using a doctype template (a custom template we created which one can see on the Print Format List), but the server side script seems to get the css from a template file (classic, standard, or modern).  

Looking at the code in print_format/print_format.py, it seems that get_html() only returns the html body, and does not use webnotes.form_dict.style. There is a separate call to return the css, get_print_style(), which takes the style ("standard", "modern", or "classic") as an argument. 

Is there some way to make the server side script access the same template that the web API approach uses?

Thanks.




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.
Yeah -- you will need to run it separately through the jinja template of print.html and pass the style (see the get_args method above get_html)

https://github.com/webnotes/wnframework/blob/master/website/templates/pages/print.html

Sorry this part is not very complete yet.


W: https://erpnext.com
T: @rushabh_mehta

On 19-Sep-2013, at 4:33 PM, Jonathan <ir...@gmail.com> wrote:

Hi,

I get a different result (html output) when using the web API approach (http://whatever.erpnext.com/web.py?page=print&doctype=Sales%20Invoice&name=INV-13-14-00027&format=SalesInvoice) vs. the server side script approach. I think this is because the web API approach is using a doctype template (a custom template we created which one can see on the Print Format List), but the server side script seems to get the css from a template file (classic, standard, or modern).  

Looking at the code in print_format/print_format.py, it seems that get_html() only returns the html body, and does not use webnotes.form_dict.style. There is a separate call to return the css, get_print_style(), which takes the style ("standard", "modern", or "classic") as an argument. 

Is there some way to make the server side script access the same template that the web API approach uses?

Thanks.





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.
Sorry, I don't understand. Below is the current server side script code for Sales Invoice. "Sales invoice Classic Footer" is set as the default template, but I seem to get "Standard". At some level, does the web api access the same "print" code as the server side script?

Thanks.

- j


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

  def custom_on_submit(self):
    webnotes.form_dict.format = "SalesInvoice" 
    webnotes.form_dict.style =  "Sales invoice Classic Footer" # "Standard" # "Classic" # "Modern"  # "Standard"   # not sure whether this template is being picked up in get_html()

    import core.doctype.print_format.print_format
    from webnotes.utils.email_lib import sendmail

    body = None
    css = None
    try:
      body = core.doctype.print_format.print_format.get_html(self.doc, self.doclist)
      css = core.doctype.print_format.print_format.get_print_style("Sales invoice Classic Footer")     # this just returns "Standard"
    except:
      tb = traceback.format_exc()
      msgprint(tb)


    msg = """
<html>
<head>
  <style type="text/css">
"""
    msg += css
    msg += """
  </style>
</head>
<body>
"""
    msg +=  body
    msg += """
</html>
"""



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.
If you have merged the lastest updates, just do this:

from webnotes.webutils import render_page

# add form parameters
webnotes.form_dict.update({
  "doctype": ..
  "name": ..
  "format": ..
  "style": ..
})

html = render_page("print")


W: https://erpnext.com
T: @rushabh_mehta

On 19-Sep-2013, at 11:57 PM, Jonathan <ir...@gmail.com> wrote:

Sorry, I don't understand. Below is the current server side script code for Sales Invoice. "Sales invoice Classic Footer" is set as the default template, but I seem to get "Standard". At some level, does the web api access the same "print" code as the server side script?

Thanks.

- j


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

  def custom_on_submit(self):
    webnotes.form_dict.format = "SalesInvoice" 
    webnotes.form_dict.style =  "Sales invoice Classic Footer" # "Standard" # "Classic" # "Modern"  # "Standard"   # not sure whether this template is being picked up in get_html()

    import core.doctype.print_format.print_format
    from webnotes.utils.email_lib import sendmail

    body = None
    css = None
    try:
      body = core.doctype.print_format.print_format.get_html(self.doc, self.doclist)
      css = core.doctype.print_format.print_format.get_print_style("Sales invoice Classic Footer")     # this just returns "Standard"
    except:
      tb = traceback.format_exc()
      msgprint(tb)


    msg = """
<html>
<head>
  <style type="text/css">
"""
    msg += css
    msg += """
  </style>
</head>
<body>
"""
    msg +=  body
    msg += """
</html>
"""




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.  That worked perfectly.

- 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,
 
I am having trouble getting this to work again. In particular, render_page("print") seems to take a very long time, but return an empty result. Also when I try the web api approach:  https://erpnext.url/web.py?page=print&doctype=Sales%20Invoice&name=INV01309&format=SalesInvoice, the return is the following empty document (see below).  Do you have any suggestions about what I am doing wrong?

Thanks.

- j


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


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Print Format</title>
<meta name="generator" content="wnframework">
<style>
</style>
</head>
<body>
</body></html>
<!-- 

page:print
load status: fresh -->




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,

We’ve fixed this issue. Please update pull updates of 1310 branch.

Best,
Anand.

On 30-Oct-2013, at 2:39 pm, Jonathan <ir...@gmail.com> wrote:

Hi,
 
I am having trouble getting this to work again. In particular, render_page("print") seems to take a very long time, but return an empty result. Also when I try the web api approach:  https://erpnext.url/web.py?page=print&doctype=Sales%20Invoice&name=INV01309&format=SalesInvoice, the return is the following empty document (see below).  Do you have any suggestions about what I am doing wrong?

Thanks.

- j


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


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Print Format</title>
<meta name="generator" content="wnframework">
<style>
</style>
</head>
<body>
</body></html>
<!-- 

page:print
load status: fresh -->





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 for the response and sorry for the belated reply. Is it sufficient to do git checkout origin 1310 and then restart the server, or are there further steps required?

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.
If you are 1310 no need to restart - its CGI :)

On Thursday, November 14, 2013 8:42:40 PM UTC+5:30, Jonathan wrote:

Thanks for the response and sorry for the belated reply. Is it sufficient to do git checkout origin 1310 and then restart the server, or are there further steps required?

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 Rushabh,

I had better clarify--I did not install ERPNext so I have no experience in this regard. Our ERPNext installation is currently on the master branch, the last commit is:

commit 865e62df61b53b3bf0b0e446e8c23e2dc99b68f2
Author: Nabin Hait <.....@...com>
Date:   Mon Sep 23 23:28:46 2013 +0530

and git status responds:

# On branch master
# Your branch is behind 'origin/master' by 597 commits, and can be fast-forwarded.
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       master.sql


Is it really sufficient simply to do git checkout origin 1310 on the live server--will all the data, custom forms, etc. be preserved? Or do I need to do some kind of backup, switch to the new branch, and restore.

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.
Jonathan, should work.

Checkout and then rebuild. (lib/wnf.py --build)

On Friday, November 15, 2013 1:52:27 PM UTC+5:30, Jonathan wrote:
Hi Rushabh,

I had better clarify--I did not install ERPNext so I have no experience in this regard. Our ERPNext installation is currently on the master branch, the last commit is:

commit 865e62df61b53b3bf0b0e446e8c23e2dc99b68f2
Author: Nabin Hait <.....@...com>
Date:   Mon Sep 23 23:28:46 2013 +0530

and git status responds:

# On branch master
# Your branch is behind 'origin/master' by 597 commits, and can be fast-forwarded.
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       master.sql


Is it really sufficient simply to do git checkout origin 1310 on the live server--will all the data, custom forms, etc. be preserved? Or do I need to do some kind of backup, switch to the new branch, and restore.

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,

Did the checkout and rebuild, then restarted the server. Things generally seem to work ok, except that I am unable to submit any document (save seems to work). The message when I try to submit is simply "Did not save".Would the fact that there is an untracked file called "master.sql" in /var/www/erpnext/app/ have any relevance?

Any suggestions? 

Thanks.


- j



On Saturday, November 16, 2013 5:56:14 AM UTC+1, rushabh wrote:
Jonathan, should work.

Checkout and then rebuild. (lib/wnf.py --build)

On Friday, November 15, 2013 1:52:27 PM UTC+5:30, Jonathan wrote:
Hi Rushabh,

I had better clarify--I did not install ERPNext so I have no experience in this regard. Our ERPNext installation is currently on the master branch, the last commit is:

commit 865e62df61b53b3bf0b0e446e8c23e2dc99b68f2
Author: Nabin Hait <.....@...com>
Date:   Mon Sep 23 23:28:46 2013 +0530

and git status responds:

# On branch master
# Your branch is behind 'origin/master' by 597 commits, and can be fast-forwarded.
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       master.sql


Is it really sufficient simply to do git checkout origin 1310 on the live server--will all the data, custom forms, etc. be preserved? Or do I need to do some kind of backup, switch to the new branch, and restore.

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,

The browser’s javascript console should give you an error trace. It should help to figure out the problem.

Best,
Anand Doshi.

On 20 November 2013 at 11:01:10 pm, Jonathan (ir...@gmail.com) wrote:

Hi,

Did the checkout and rebuild, then restarted the server. Things generally
seem to work ok, except that I am unable to submit any document (save seems
to work). The message when I try to submit is simply “Did not save”.Would
the fact that there is an untracked file called “master.sql” in
/var/www/erpnext/app/ have any relevance?

Any suggestions?

Thanks.

  • j

On Saturday, November 16, 2013 5:56:14 AM UTC+1, rushabh wrote:

Jonathan, should work.

Checkout and then rebuild. (lib/wnf.py --build)

On Friday, November 15, 2013 1:52:27 PM UTC+5:30, Jonathan wrote:

Hi Rushabh,

I had better clarify–I did not install ERPNext so I have no experience
in this regard. Our ERPNext installation is currently on the master branch,
the last commit is:

commit 865e62df61b53b3bf0b0e446e8c23e2dc99b68f2
Author: Nabin Hait <…@…com>
Date: Mon Sep 23 23:28:46 2013 +0530

and git status responds:

On branch master

Your branch is behind ‘origin/master’ by 597 commits, and can be

fast-forwarded.

Untracked files:

(use “git add …” to include in what will be committed)

master.sql

Is it really sufficient simply to do git checkout origin 1310 on the live
server–will all the data, custom forms, etc. be preserved? Or do I need to
do some kind of backup, switch to the new branch, and restore.

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.


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.