Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
17433 Zobrazení

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
Zrušit
Nejlepší odpověď

in odoo 18 do connect sales order and invoice on the level of sales order line and invoice line

so update the sales order line with the id of the invoice line in field invoice_lines.

(took me some hours ;-) )

Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit

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 Odpovědi Zobrazení Aktivita
0
pro 18
4580
1
lis 16
5408
2
lis 16
13501
1
bře 16
8175
2
čvn 25
804