تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
17498 أدوات العرض

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
ديسمبر 18
4652
1
نوفمبر 16
5481
2
نوفمبر 16
13586
1
مارس 16
8221
2
يونيو 25
863