diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index dbcd76986dd..98e0e9bf163 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -306,8 +306,8 @@ class mrp_bom(osv.osv): if set(map(int,bom_line_id.property_ids or [])) - set(properties or []): continue # all bom_line_id variant values must be in the product - if bom_line_id.variants_ids: - if not product or (set(map(int,bom_line_id.variants_ids or [])) - set(map(int,product.variant_ids))): + if bom_line_id.variant_ids: + if not product or (set(map(int,bom_line_id.variant_ids or [])) - set(map(int,product.variant_ids))): continue if bom_line_id.product_id.id in all_prod: @@ -393,7 +393,7 @@ class mrp_bom_line(osv.osv): 'property_ids': fields.many2many('mrp.property', string='Properties'), 'bom_id': fields.many2one('mrp.bom', 'Parent BoM', ondelete='cascade', select=True, required=True), - 'variants_ids': fields.many2many('product.attribute.value', string='Variants', help="BOM Product Variants needed form apply this line."), + 'variant_ids': fields.many2many('product.attribute.value', string='Variants', help="BOM Product Variants needed form apply this line."), } def _get_uom_id(self, cr, uid, *args): diff --git a/addons/mrp/mrp_demo.xml b/addons/mrp/mrp_demo.xml index d6a3e65ff5e..1232d1b746b 100644 --- a/addons/mrp/mrp_demo.xml +++ b/addons/mrp/mrp_demo.xml @@ -448,7 +448,7 @@ PC Assemble + 2GB RAM - + 5 phantom @@ -607,6 +607,41 @@ + + iPad Retina Display + + + 1 + normal + + + + 1 + + 1 + normal + + + + + + 1 + + 2 + normal + + + + + + 1 + + 3 + normal + + + + diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 6da46f14d46..c9ee9f63732 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -385,7 +385,7 @@ - + @@ -493,7 +493,7 @@ - + diff --git a/addons/product/product.py b/addons/product/product.py index ea62786fd40..58391d886d0 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -628,7 +628,7 @@ class product_template(osv.osv): all_variants = temp_variants # check product - variants_ids_to_active = [] + variant_ids_to_active = [] variants_active_ids = [] variants_inactive = [] for product_id in tmpl_id.product_variant_ids: @@ -637,11 +637,11 @@ class product_template(osv.osv): variants_active_ids.append(product_id.id) all_variants.pop(all_variants.index(variants)) if not product_id.active: - variants_ids_to_active.append(product_id.id) + variant_ids_to_active.append(product_id.id) else: variants_inactive.append(product_id) - if variants_ids_to_active: - product_obj.write(cr, uid, variants_ids_to_active, {'active': True}, context=ctx) + if variant_ids_to_active: + product_obj.write(cr, uid, variant_ids_to_active, {'active': True}, context=ctx) # create new product for variant_ids in all_variants: