Skip to content
Snippets Groups Projects
Commit 157db49d authored by Josse Colpaert's avatar Josse Colpaert
Browse files

[FIX] mrp: in production orders, we don't want the possibility to select phantom BoMs

As the finished move or the one after might automatically split into its components,
it is not a good idea to select a Phantom BoM for a production order, so
this is for the moment, the best way to avoid it.
parent 98c97b03
Branches
Tags
No related merge requests found
......@@ -230,7 +230,10 @@ class MrpProduction(models.Model):
self.bom_id = False
else:
bom = self.env['mrp.bom']._bom_find(product=self.product_id, picking_type=self.picking_type_id, company_id=self.company_id.id)
self.bom_id = bom.id
if bom.type == 'normal':
self.bom_id = bom.id
else:
self.bom_id = False
self.product_uom_id = self.product_id.uom_id.id
return {'domain': {'product_uom_id': [('category_id', '=', self.product_id.uom_id.category_id.id)]}}
......
......@@ -93,7 +93,7 @@
string="Update" states="confirmed,planned,progress" class="oe_link" attrs="{'invisible': [('state','=','done')]}"/>
</div>
<field name="bom_id"
domain="['|',
domain="['&amp;', '|',
('product_id','=',product_id),
'&amp;',
('product_tmpl_id.product_variant_ids','=',product_id),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment