From 808238212e5b5ae76ebf1a44abb219d616e295a5 Mon Sep 17 00:00:00 2001 From: Florent de Labarre Date: Wed, 5 Jun 2019 15:19:14 +0000 Subject: [PATCH] [FIX] mrp: add persistent domain Steps to reproduce the bug: - Create a product template A with variant color: black and white. - Create attribute : size : 16gb and 32 gb - Create a bom with template A. - Add a bom line L with product B - Save the bom ,edit it and select an attribute value for L Bug: All attribute values of the database (color: white, color: black, size: 16 gb, size 32 gb) were displayed. opw:2006988 closes odoo/odoo#33949 Signed-off-by: Simon Goffin (sig) --- addons/mrp/models/mrp_bom.py | 1 + addons/mrp/views/mrp_bom_views.xml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/mrp/models/mrp_bom.py b/addons/mrp/models/mrp_bom.py index b5090302894..aa87a276c04 100644 --- a/addons/mrp/models/mrp_bom.py +++ b/addons/mrp/models/mrp_bom.py @@ -230,6 +230,7 @@ class MrpBomLine(models.Model): 'mrp.bom', 'Parent BoM', index=True, ondelete='cascade', required=True) parent_product_tmpl_id = fields.Many2one('product.template', 'Parent Product Template', related='bom_id.product_tmpl_id') + valid_product_attribute_value_ids = fields.Many2many('product.attribute.value', related='bom_id.product_tmpl_id.valid_product_attribute_value_ids') attribute_value_ids = fields.Many2many( 'product.attribute.value', string='Apply on Variants', help="BOM Product Variants needed form apply this line.") diff --git a/addons/mrp/views/mrp_bom_views.xml b/addons/mrp/views/mrp_bom_views.xml index c9dfe4db741..16628f89324 100644 --- a/addons/mrp/views/mrp_bom_views.xml +++ b/addons/mrp/views/mrp_bom_views.xml @@ -66,8 +66,9 @@