API for ERPNext

Hi Anand,

Thanks for the very quick clarification. That is super.

The next thing to ask about is access to "print" functionality from the Web Service API. In other words, would it be possible to have a print function which given a doctype and an id (for example, a particular invoice) and maybe a template id, returns the html or pdf that would be generated by hitting the "print" button from within ERPNext?

Thanks,

- j

On Monday, August 19, 2013 5:15:14 PM UTC+2, Anand Doshi wrote:
Hi Jonathan,

Calculations are triggered automatically on save, in the validate method. So insert/save/submit calls will trigger calculations.

Thanks,
Anand.

On 19-Aug-2013, at 8:40 PM, Jonathan <ir...@gmail.com> wrote:

Hi Anand,

Sorry I am just now getting back to this. Perhaps I didn't phrase the original question very well. I am interested in somehow triggering this calculation from  the Web Service API, and preferably without importing client.py. Is that now possible?

Thanks.

- j



On Monday, June 3, 2013 12:32:52 PM UTC+2, Anand Doshi wrote:
Hi Jonathan,

We have ported the calculation code to the server side, but it is still in testing. It should be released by end of this month.

This will calculate everything again on the server side. So it solves the problem for users pushing through API and also opens up the possibility of transaction import.

If you want it earlier, you can switch to the "responsive" branch of erpnext and wnframework repositories. (Warning: it is in alpha stage and under testing, though we are using it on our account)

Thanks,
Anand.

On 03-Jun-2013, at 3:56 PM, Jonathan <ir...@gmail.com> wrote:


Hi Rushabh,

In certain doctypes, such as Sales Order, there is a button "Get Taxes and Charges" which calculates additional charges based on one of the templates found in "Sales Taxes and Charges Master List". We would like to invoke this functionality from the API, but it is all located in the ERPNext javascript client. One really nasty hack would be to bring up the page in a headless browser and "click" the button from a script. But trying to do this more cleanly by duplicating the calculation logic in our script, I have not had any luck accessing the templates from the API. 

Do you have any suggestions for how to move forward?

Thanks.

- j

 
Already is!

Example:


or


pass doctype, name, format and style to "print"

or pass page=print to server.py

(you need to be logged it to check this)

The only print format we have ready out of the box for server-side is SalesInvoice.

best,
Rushabh

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

On 30-May-2013, at 7:59 PM, Amin Zayani <za...@gmail.com> wrote:

Hi Rushabh,

now that the print templates are server generated, is there any chance to have a "print" method accessible by the API?

Best regards,

Amin

On Monday, March 11, 2013 5:27:13 AM UTC+1, rushabh wrote:
Jonathan,

Unfortunately thats not easy at the moment because our prints are build in the client (using JS). We are aware its a bad design and its on our re-write agenda. Will keep you updated on the forum when its done. Estimating about a month or so.

best,
Rushabh


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

On 10-Mar-2013, at 1:14 PM, Jonathan <ir...@gmail.com> wrote:


Hi Rushabh,

Would there be any chance of adding a "print" to the API? I guess it would take doctype, name, and a format as arguments, and return (or somehow give access to) the pdf.

Thanks.

- j



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 post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/MvjaH0TPKJEJ.

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

 

 





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 post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f6c65220-2fd5-4a3b-8a28-94133c81e0f3%40googlegroups.com?hl=en.

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

 

 





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 post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/cdbbdedf-5b8d-4fe6-a684-af48c0a0ecdb%40googlegroups.com?hl=en.

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

The next thing to ask about is access to "print" functionality from the Web Service API. In other words, would it be possible to have a print function which given a doctype and an id (for example, a particular invoice) and maybe a template id, returns the html or pdf that would be generated by hitting the "print" button from within ERPNext?

Already posted on this thread earlier. Pls check.


Thanks,

- j

On Monday, August 19, 2013 5:15:14 PM UTC+2, Anand Doshi wrote:
Hi Jonathan,

Calculations are triggered automatically on save, in the validate method. So insert/save/submit calls will trigger calculations.

Thanks,
Anand.

On 19-Aug-2013, at 8:40 PM, Jonathan <ir...@gmail.com> wrote:

Hi Anand,

Sorry I am just now getting back to this. Perhaps I didn't phrase the original question very well. I am interested in somehow triggering this calculation from  the Web Service API, and preferably without importing client.py. Is that now possible?

Thanks.

- j



On Monday, June 3, 2013 12:32:52 PM UTC+2, Anand Doshi wrote:
Hi Jonathan,

We have ported the calculation code to the server side, but it is still in testing. It should be released by end of this month.

This will calculate everything again on the server side. So it solves the problem for users pushing through API and also opens up the possibility of transaction import.

If you want it earlier, you can switch to the "responsive" branch of erpnext and wnframework repositories. (Warning: it is in alpha stage and under testing, though we are using it on our account)

Thanks,
Anand.

On 03-Jun-2013, at 3:56 PM, Jonathan <ir...@gmail.com> wrote:


Hi Rushabh,

In certain doctypes, such as Sales Order, there is a button "Get Taxes and Charges" which calculates additional charges based on one of the templates found in "Sales Taxes and Charges Master List". We would like to invoke this functionality from the API, but it is all located in the ERPNext javascript client. One really nasty hack would be to bring up the page in a headless browser and "click" the button from a script. But trying to do this more cleanly by duplicating the calculation logic in our script, I have not had any luck accessing the templates from the API. 

Do you have any suggestions for how to move forward?

Thanks.

- j

 
Already is!

Example:


or


pass doctype, name, format and style to "print"

or pass page=print to server.py

(you need to be logged it to check this)

The only print format we have ready out of the box for server-side is SalesInvoice.

best,
Rushabh

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

On 30-May-2013, at 7:59 PM, Amin Zayani <za...@gmail.com> wrote:

Hi Rushabh,

now that the print templates are server generated, is there any chance to have a "print" method accessible by the API?

Best regards,

Amin

On Monday, March 11, 2013 5:27:13 AM UTC+1, rushabh wrote:
Jonathan,

Unfortunately thats not easy at the moment because our prints are build in the client (using JS). We are aware its a bad design and its on our re-write agenda. Will keep you updated on the forum when its done. Estimating about a month or so.

best,
Rushabh


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

On 10-Mar-2013, at 1:14 PM, Jonathan <ir...@gmail.com> wrote:


Hi Rushabh,

Would there be any chance of adding a "print" to the API? I guess it would take doctype, name, and a format as arguments, and return (or somehow give access to) the pdf.

Thanks.

- j



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 post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/MvjaH0TPKJEJ.

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

 

 





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 post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f6c65220-2fd5-4a3b-8a28-94133c81e0f3%40googlegroups.com?hl=en.

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

 

 





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 post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/cdbbdedf-5b8d-4fe6-a684-af48c0a0ecdb%40googlegroups.com?hl=en.

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.



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.
Oops, very sorry about that--it must be the drugs.

Cheers,

- j


On Monday, August 19, 2013 7:25:59 PM UTC+2, rushabh wrote:
Jonathan,

The next thing to ask about is access to "print" functionality from the Web Service API. In other words, would it be possible to have a print function which given a doctype and an id (for example, a particular invoice) and maybe a template id, returns the html or pdf that would be generated by hitting the "print" button from within ERPNext?

Already posted on this thread earlier. Pls check.


Thanks,

- j

On Monday, August 19, 2013 5:15:14 PM UTC+2, Anand Doshi wrote:
Hi Jonathan,

Calculations are triggered automatically on save, in the validate method. So insert/save/submit calls will trigger calculations.

Thanks,
Anand.

On 19-Aug-2013, at 8:40 PM, Jonathan <ir...@gmail.com> wrote:

Hi Anand,

Sorry I am just now getting back to this. Perhaps I didn't phrase the original question very well. I am interested in somehow triggering this calculation from  the Web Service API, and preferably without importing client.py. Is that now possible?

Thanks.

- j



On Monday, June 3, 2013 12:32:52 PM UTC+2, Anand Doshi wrote:
Hi Jonathan,

We have ported the calculation code to the server side, but it is still in testing. It should be released by end of this month.

This will calculate everything again on the server side. So it solves the problem for users pushing through API and also opens up the possibility of transaction import.

If you want it earlier, you can switch to the "responsive" branch of erpnext and wnframework repositories. (Warning: it is in alpha stage and under testing, though we are using it on our account)

Thanks,
Anand.

On 03-Jun-2013, at 3:56 PM, Jonathan <ir...@gmail.com> wrote:


Hi Rushabh,

In certain doctypes, such as Sales Order, there is a button "Get Taxes and Charges" which calculates additional charges based on one of the templates found in "Sales Taxes and Charges Master List". We would like to invoke this functionality from the API, but it is all located in the ERPNext javascript client. One really nasty hack would be to bring up the page in a headless browser and "click" the button from a script. But trying to do this more cleanly by duplicating the calculation logic in our script, I have not had any luck accessing the templates from the API. 

Do you have any suggestions for how to move forward?

Thanks.

- j

 
Already is!

Example:


or


pass doctype, name, format and style to "print"

or pass page=print to server.py

(you need to be logged it to check this)

The only print format we have ready out of the box for server-side is SalesInvoice.

best,
Rushabh

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

On 30-May-2013, at 7:59 PM, Amin Zayani <za...@gmail.com> wrote:

Hi Rushabh,

now that the print templates are server generated, is there any chance to have a "print" method accessible by the API?

Best regards,

Amin

On Monday, March 11, 2013 5:27:13 AM UTC+1, rushabh wrote:
Jonathan,

Unfortunately thats not easy at the moment because our prints are build in the client (using JS). We are aware its a bad design and its on our re-write agenda. Will keep you updated on the forum when its done. Estimating about a month or so.

best,
Rushabh


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

On 10-Mar-2013, at 1:14 PM, Jonathan <ir...@gmail.com> wrote:


Hi Rushabh,

Would there be any chance of adding a "print" to the API? I guess it would take doctype, name, and a format as arguments, and return (or somehow give access to) the pdf.

Thanks.

- j



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 post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/MvjaH0TPKJEJ.

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

 

 





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 post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f6c65220-2fd5-4a3b-8a28-94133c81e0f3%40googlegroups.com?hl=en.

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

 

 





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 post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/cdbbdedf-5b8d-4fe6-a684-af48c0a0ecdb%40googlegroups.com?hl=en.

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.



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,

Would it be possible (or is it already working somehow) to have a variant of the get_doc API call--using filters--that would return the list of names of all matching doctypes? I think at the moment get_doc returns the first match, which has been sufficient up to now.

Thanks very much,

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

You can use this method:

https://github.com/webnotes/wnframework/blob/master/webnotes/client.py#L11

Pass filters as a json dict.


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

On 17-Sep-2013, at 6:01 PM, Jonathan <ir...@gmail.com> wrote:

Hi,

Would it be possible (or is it already working somehow) to have a variant of the get_doc API call--using filters--that would return the list of names of all matching doctypes? I think at the moment get_doc returns the first match, which has been sufficient up to now.

Thanks very much,

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