Files
odoo_source/addons
lase@odoo.com 6fcd31cc21 [FIX] mrp_subcontracting : generates BOM for dynamic attributes
Current Behavior:

Traceback when printing the BOM overview.

Expected behavior:

Generates a PDF of the BOM overview even if the information displayed
is entirely relevant.

Steps to reproduce:

Inventory > Configuration > Products > Attributes

Create an attribute with Variants Creation Mode set to "Dynamically".

Create a new product with this single attribute and multiple values.

Create a BOM for this product with BOM Type set to "Subcontracting".

Print the BOM overview.

Cause of the issue:

Creating such a product generates a 'product.template' that is not
associated to any variant and hence does not correspond to any
'product.product'. As a result the function_get_bom_data made can not
apply the method _select_seller properly in that case.

Notes:

 - There is no error if a variant was manually created for that product.
 - If the Variants Creation Mode set to "Dynamically" a variant is still
   automatically created to be associated to the product tempalte so
   that the erro does not rise.

Fix:

As the _select_seller method is only defined for product.product
and not for product.template, we can not not apply it here.
Furhtermore, since the additional informations provided by the
override of the method get_bom_data in the the BOM overview will
not be relevant without the existence of a variant, we skip this part of
the code when the argument of _select_seller is not valid.

opw-3698050

closes odoo/odoo#156346

X-original-commit: b983026f004d4958d2a47a0dac9b1b54e24ab04c
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Lancelot Semal (lase) <lase@odoo.com>
2024-03-05 14:22:22 +00:00
..
2024-02-22 09:06:12 +00:00
2024-01-15 09:30:53 +00:00
2024-01-26 09:13:03 +00:00
2024-03-05 08:27:47 +00:00