Skip to Content
Menu
This question has been flagged
1 Reply
1297 Views

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
Discard
Best Answer

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
Discard
Related Posts Replies Views Activity
1
Aug 24
354
3
Aug 24
1826
1
Feb 24
1122
3
Oct 23
9065
3
Oct 23
1240