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:
'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):
<record id="mrp_bom_8" model="mrp.bom">
<field name="name">PC Assemble + 2GB RAM</field>
- <field name="product_tmpl_id" ref="product.product_product_4_product_template"/>
+ <field name="product_tmpl_id" ref="product.product_product_3_product_template"/>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="sequence">5</field>
<field name="type">phantom</field>
<field name="bom_id" ref="mrp_bom_10"/>
</record>
+ <record id="mrp_bom_11" model="mrp.bom">
+ <field name="name">iPad Retina Display</field>
+ <field name="product_tmpl_id" ref="product.product_product_4_product_template"/>
+ <field name="product_uom" ref="product.product_uom_unit"/>
+ <field name="sequence">1</field>
+ <field name="type">normal</field>
+ </record>
+ <record id="mrp_bom_line_32" model="mrp.bom.line">
+ <field name="product_id" ref="product.product_product_14"/>
+ <field name="product_qty">1</field>
+ <field name="product_uom" ref="product.product_uom_unit"/>
+ <field name="sequence">1</field>
+ <field name="type">normal</field>
+ <field name="variant_ids" eval="[(6,0,[ref('product.product_attribute_value_1')])]"/>
+ <field name="bom_id" ref="mrp_bom_11"/>
+ </record>
+ <record id="mrp_bom_line_33" model="mrp.bom.line">
+ <field name="product_id" ref="product.product_product_15"/>
+ <field name="product_qty">1</field>
+ <field name="product_uom" ref="product.product_uom_unit"/>
+ <field name="sequence">2</field>
+ <field name="type">normal</field>
+ <field name="variant_ids" eval="[(6,0,[ref('product.product_attribute_value_2')])]"/>
+ <field name="bom_id" ref="mrp_bom_11"/>
+ </record>
+ <record id="mrp_bom_line_34" model="mrp.bom.line">
+ <field name="product_id" ref="product.product_product_23"/>
+ <field name="product_qty">1</field>
+ <field name="product_uom" ref="product.product_uom_unit"/>
+ <field name="sequence">3</field>
+ <field name="type">normal</field>
+ <field name="bom_id" ref="mrp_bom_11"/>
+ </record>
+
+
<record id="mrp_production_1" model="mrp.production">
<field name="product_id" ref="product.product_product_4"/>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="date_start"/>
<field name="date_stop"/>
<field name="routing_id"/>
- <field name="variants_ids" widget="many2many_tags"/>
+ <field name="variant_ids" widget="many2many_tags"/>
</tree>
</field>
</page>
<field name="date_start"/>
<field name="date_stop"/>
<field name="routing_id"/>
- <field name="variants_ids" widget="many2many_tags"/>
+ <field name="variant_ids" widget="many2many_tags"/>
<field name="property_ids" widget="many2many_tags"/>
</tree>
</field>
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:
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: