Skip to Content
Menu
This question has been flagged
2 Replies
15902 Views

I am trying to integrate odoo with another application which is based on php. And to connect odoo using php I am using Odoo webservices. I have created sales order from my application to odoo. But now I want to create invoices and link them to sale orders which I have already created.

I want to know how I can link them. Anyone who have done this can help me. Please let me know.

Avatar
Discard
Best Answer

seems like you want create invoice and then link to sale order, which is not a good practice, Even though if invoice is created from external source like magento, prestashop etc. in such cases add event or observer on external app and call invoice create from SO.

Still you can achieve this by script that'll update invoice_ids from sale order {'invoice_ids':[(4, invoice_id)]}


Avatar
Discard
Best Answer

Hi,

If you create sale order and  the invoice, Then to link the invoice with the sales, you can add the id's of the invoices you have created to the field name invoice_ids in sale.order model.  This is a many2many field.


Thanks

Avatar
Discard

I already add the field to Sales Order form by Studio, but when i try to add an invoice, and i save the Sales order, the added invoice disappear from the M2M invoice_ids. ¿Any solution?

Thanks.

Related Posts Replies Views Activity
0
Dec 18
3697
1
Nov 16
4387
2
Nov 16
12217
1
Mar 16
7206
0
Feb 24
218