OCA / manufacture

Odoo Manufacturing Addons
GNU Affero General Public License v3.0
173 stars 484 forks source link

[16.0][BUG] mrp_multi_level: using wrong variant BOM #1366

Open matt454357 opened 2 weeks ago

matt454357 commented 2 weeks ago

Version 16.0 module mrp_multi_level is using the wrong variant BOM, when multiple variant BOMs exist.

This code should look for a variant specific BOM:

https://github.com/OCA/manufacture/blob/1f34d36b10fb9079add5e43cf7aaaf6811e2f60c/mrp_multi_level/wizards/mrp_multi_level.py#L183-L185

To Reproduce

Add attribute "Legs" and values "Steel" and "Aluminum" on product FP-2:

Screenshot at 2024-10-16 18-37-06

Create BOMs for the two variants as follows:

Screenshot at 2024-10-16 18-32-09

Screenshot at 2024-10-16 18-32-38

Create outbound move for product FP-2 (Aluminum):

Screenshot at 2024-10-16 18-42-28

We expect a planned order for SF-2, but we get a planned order for SF-1:

Screenshot at 2024-10-16 18-35-28

matt454357 commented 2 weeks ago

The OCA module product_configurator_mrp has been creating individual BOMs for each variant since version 13.0.

https://github.com/OCA/product-configurator/tree/14.0/product_configurator_mrp

So, while the current method of selecting a BOM works with the core odoo demo data, it does not work with the OCA product configurator.