Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
17409 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Mejor respuesta

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
Descartar
Mejor respuesta

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
Descartar

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.

Publicaciones relacionadas Respuestas Vistas Actividad
0
dic 18
4576
1
nov 16
5387
2
nov 16
13457
1
mar 16
8157
2
jun 25
767