Contributors mailing list archives

contributors@odoo-community.org

Browse archives

Avatar

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

by
ClosingAp Open Source Integrators Europe, LDA, Daniel Reis
- 10/06/2021 12:59:53
Hello Aires,

It is not clear, but I feel that you are doing the export based on Product Template + Attributes, that will later trigger the Variant creation.
I suggest you to instead export/import the Product Variants (product.product), along with the related attribute data, and let the implicit Product Template record be automatically created.

For the record I did a quick test (14.0), and:
- if you import a "MYPRODUCT" Product Template, it has a __import__.MYPRODUCT XMLId and creates a related Product Variant with no XMLId.
- if you import a "MYPRODUCT" Product Variant,  it has a __import__.MYPRODUCT XMLId and creates a related Product Template with XMLId __import__.MYPRODUCT_product_template.

This is helpful for that cases where you have relations to Product Template records (BoMs for example).

I hope this helps.

Thanks
Daniel

On 10/06/2021 08:57, Aires Silvestre wrote:

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?

Regards

--
ALIEN GROUP LDA

Aires Silvestre

COO | Odoo Consultant

em.aires.silvestre@alien-group.com

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: www.alien-group.com, Email: geral@alien-group.com

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

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe


--
Daniel Reis
Managing Director
M: +351 919991307
E: DReis@OpenSourceIntegrators.com
Av Doutor Desidério Cambournac 12 • 2710-553 Sintra, Portugal


Reference