Contributors mailing list archives

Browse archives


Re: Transfer/Migrate Product with Variants Keeping External Identifier for product.product

by "Richard deMeester" <> - 10/06/2021 10:40:15


Are you having trouble with generating your own identifiers when you create the products?

Remember, they are just in a table.

If you have data in a module, the external identifiers are fixed by the id in the xml.

When you export anything in Odoo, it will use that identifier, or it will look for what identifier has been used, and if it is not there, will create its own?

So after importing your products in your new database, you could set / override the external identifier to be what it was in your export?

Without knowing what you have done, and what the endgame is exactly, I would have thought it a not too difficult task to replace the identifiers in your new db with what they were in the old db, ensuring that future exports from either source would have the same identifier.


Richard deMeester

Senior Development Analyst

WilldooIT Pty Ltd


M: +61 403 76 76 76

P: +61 3 9135 1900

A: 10/435 Williamstown Road, Port Melbourne, Vic 3207



Making growth through technology easy



DISCLAIMER | This electronic message together with any attachments is confidential. If you are not the recipient, do not copy, disclose, or use the contents in any way. Please also advise us by e-mail that you have received this message in error and then please destroy this email and any of its attachments. WilldooIT Pty. Ltd. is not responsible for any changes made to this message and/or any attachments after sending by WilldooIT Pty. Ltd. WilldooIT Pty. Ltd. use virus scanning software but exclude all liability for virus or anything similar in this email or attachment.

From: Aires Silvestre <>
Sent: Thursday, 10 June 2021 5:57 PM
To: Contributors <>
Subject: Transfer/Migrate Product with Variants Keeping External Identifier for product.product

Hello everyone

I need to transfer products with variants from one Odoo database to another and have one requirement:

To keep the exact external identifier for both product.template and product.product records. 

I need specially to preserve the external identifier for product.product (Product Variants) because later on I'll have to transfer stock moves and, yes, what is referenced in stock moves, sales, purchases, is product.product (and not product.template).

I've successfully exported products with variants (exported "attribute_line_ids/attribute_id/id" and "attribute_line_ids/value_ids/id") and import them in the destination database and everything is OK, products with variants are replicated but at the end variants (product.product records) have no external identifier, and I need them.

Can someone help, please?



Aires Silvestre

COO | Odoo Consultant

tm.+244 913 728 650

Código QR

Rua Doutor Agostinho Neto, 156, Bairro Azul, Luanda - Angola, Tel: +244 913 728 600 | +244 913 728 650,
Website:, Email:

Não imprima este email caso não seja estritamente necessário. A Terra agradece-lhe!

Post to: