This question has been flagged
4 Replies
2261 Views

Hello

I am trying to import BOMs on items that have the 'Apply on Variants' set for individual BOM components. I can't seem to figure out how to specify the apply on variants through the import. I have tried pretty much every combination BoM Lines/Apply on Variants, BoM Lines/Apply on Variants/Database ID, BoM Lines/Apply on Variants/External ID. The closest I have gotten is using the physical attribute value name (Kona, White, Black etc.) as 'BoM Lines/Apply on Variants' but I end up getting a baffling error about another product that is totally unrelated to the one I am trying to import a BOM for.


"Unknown error during import: <class 'odoo.exceptions.ValidationError'>: The attribute value Polymer Brights: Kona set on product PLUG UMB HOLE MG POLYMER does not match the BoM product 8800-1 BACK. between rows 2 and 13

Resolve other errors first"

I would assume it must be possible, I must just be missing something.
Avatar
Discard
Author Best Answer

Ok I have figured this out. It seems that Odoo creates an ID for product variants that is unique to whichever item you are trying to import BOM's for. You can export this data to find that unique ID and then use it in the BOM import to specify material applied to any particular variant within that specific item.

Avatar
Discard
Best Answer

You need to go to Inventory > Products > Products, select the product for the one you are creating the BOM and export the fields you need + attribute_line_ids/product_template_value_ids/product_attribute_value_id.  This will be the ID for the attribute value.  Then go to Manufacturing > List of Materials > import records.  Get your excel file, build BOM and choose to import field bom_line_ids/bom_product_template_attribute_value_ids/id and there put the value IDs exported above, if you have more than 1 attribute value that applies to that BOM line, then you should separate them by a comma.

Avatar
Discard
Best Answer

For "BoM Lines / Apply on Variants" looking at the import file page, it looks like you can only provide ".. / External ID" or "../ Database ID"

Odoo lets you export all kinds of info about Apply on Variants but it doesn't recognize them when importing back. The option is not available to select in the import file page columns. This happens even when "import-compatible export" is checked off.

This may very well be a bug. I testing this in 16.0

Ideally, it should recognize these, but it doesn't.

BoM Lines/Apply on Variants/Attribute BoM Lines/Apply on Variants/Value


Avatar
Discard
Best Answer

Hi Jake: The error seems to indicate that the variant specified does not match the product for which the BoM is created. For example, your product "8800-1 BACK" should have a variant called "Polymer Brights: Kona" defined on it before you can use it in your BoM.

Avatar
Discard
Author

Hi Paresh, I double checked that I had my All of my 'Polymer Brights' variants setup in the product template for this item, including Kona.