跳至内容
菜单
此问题已终结
3 回复
17465 查看

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.

形象
丢弃
最佳答案

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 ;-) )

形象
丢弃
最佳答案

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)]}


形象
丢弃
最佳答案

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

形象
丢弃

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.

相关帖文 回复 查看 活动
0
12月 18
4626
1
11月 16
5442
2
11月 16
13550
1
3月 16
8192
2
6月 25
845