Passa al contenuto
Menu
La domanda è stata contrassegnata
1 Rispondi
2042 Visualizzazioni

I'm importing invoices and their associated line items from a third-party legacy system and as such, I'm using the External ID when importing the Invoice and the associated Invoice Line Item.

 

However, no matter how I approach it, Odoo keeps ignoring the External Id belonging to the Invoice Line Item.

This means that when I re-import the Invoice Line Item, Odoo duplicates instead of updating the existing Line Item entry.

 

The strange thing is that I don't have this issue at all when importing Purchase Orders and their associated line items.

 

My import steps are as follows:

(a) Import the Invoice with no line items associated with it. (See file: invoice.csv http://dl.archwayproducts.com/downloads/odoo/invoices.csv)

(b) Import the Invoices line items associating them with the Invoice created in step (a) above. (See file: invoice_line_items.csv http://dl.archwayproducts.com/downloads/odoo/invoice_items.csv) )

 

But the issue is that each time I import invoice_line_items.csv, it create a new line item instead of updating the existing one.

It's as if the Invoice lines / External ID field is ignored and Odoo generates its own External Id when creating the record instead.

 

Is there any reason why this would be? Especially seeing that the very same procedure works perfectly when importing Purchase Orders and their associated line items.


Avatar
Abbandona
Risposta migliore

i've tried your file in demo.odoo.com and yes, the issue does exist. 

actually, Odoo does not create external ID for any data created in the system. so, in your case, Odoo treat your invoice line, just like when creating them by GUI (click Add a line). i haven't checked the code, but i think this issue is related to the usage of account.move.line model both in the invoice line and journal items.

but you can try to change the External ID of Invoice line in your file, into Database ID. i've tried this method and it works. to know the IDs, you have to show it in the invoice line tree view, though

hope it helps.

Fady Noor Ilmi

Arkana Solusi Digital, Indonesia


Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
mag 25
1239
4
mag 25
4908
1
ago 24
2204
1
feb 24
3031
3
ott 23
11060