[FIX] mrp: allow to use variant in order to build another variant

Usecase for example A black T-shirt made  from a white T-shirt and
black color. This behavior was possible in 12.0 and 11.0 and was
removed by commit 77a8d92196

Close #40540

closes odoo/odoo#44084

X-original-commit: 575353e251a0cce3bbff759edaeb56b5718beb11
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
This commit is contained in:
Arnold Moyaux
2020-01-28 11:13:36 +00:00
parent b266c58d56
commit 7466f2cae8
-2
View File
@@ -86,8 +86,6 @@ class MrpBom(models.Model):
for bom_line in bom.bom_line_ids:
if bom.product_id and bom_line.product_id == bom.product_id:
raise ValidationError(_("BoM line product %s should not be the same as BoM product.") % bom.display_name)
if bom_line.product_tmpl_id == bom.product_tmpl_id:
raise ValidationError(_("BoM line product %s should not be the same as BoM product.") % bom.display_name)
if bom.product_id and bom_line.bom_product_template_attribute_value_ids:
raise ValidationError(_("BoM cannot concern product %s and have a line with attributes (%s) at the same time.")
% (bom.product_id.display_name, ", ".join([ptav.display_name for ptav in bom_line.bom_product_template_attribute_value_ids])))