Importing products with & without product variants
How do I import products with & without variants in Odoo v11, whilst specifying all the external IDs?
I can import via products.templates.csv and specify attribute_line_ids/attribute_id/id and attribute_line_ids/value_ids/id, but that doesn't let me specify the external ID for the variants.
If I import via product.templates.csv but *don't* specify any variants and instead import them via product.product.csv, then I can specify the external ID for the variants, but I get an additional unwanted variant (with no attributes) automatically generated by the initial import of products.templates.csv with zero variants specified, and a random external ID.
What am I missing?
Odoo 12 brings a good solution to that.
1. Create or import your product templates.
2. Configure their attributes with "Variant Creation Mode" set on "Dynamically", ie variants are generated on demand, when requested in sales/ecommerce orders. BTW This mode is useful if you manage custom products that you only purchase or produce on customer request (no preliminary stock). For perf reasons, Odoo suggests to use this mode when the # of attribute combinations is too high.
3. Import product variants with all their specific data (from menu *Products > Product Variants*): related product template, attribute values (only the name or xmlid of the value is needed), internal reference, barcode, image, standard cost. Not the sales price as it is managed through extra costs on product template attributes or through pricelists that you can create or import afterwards.
Odoo will do the correct matching between the attribute values set on the product template and the ones of the variants, when it comes to select a combination in the product configurator of sales and ecommerce apps.
I also stress out the fact that importing variants as such is only needed if you need the product configurator to select variants. Otherwise you can import all your product items as product templates.