Skip to content

Commit

Permalink
[FIX] mrp: Changing the routing on a bom
Browse files Browse the repository at this point in the history
When changing the routing on a bom, "Consumed in Operation" indicated
in some lines of the BoM did not correspond to the routing used.
So the system did not link it to a workorder and it was never consumed when
a MO was processed.

Now the "Consumed in operation" are reset  when the routing is changed.

opw:807560
  • Loading branch information
jco-odoo authored and simongoffin committed Feb 20, 2018
1 parent a0f8ee9 commit c0f15c5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions addons/mrp/models/mrp_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ def onchange_product_tmpl_id(self):
if self.product_tmpl_id:
self.product_uom_id = self.product_tmpl_id.uom_id.id

@api.onchange('routing_id')
def onchange_routing_id(self):
for line in self.bom_line_ids:
line.operation_id = False

@api.multi
def name_get(self):
return [(bom.id, '%s%s' % (bom.code and '%s: ' % bom.code or '', bom.product_tmpl_id.display_name)) for bom in self]
Expand Down

0 comments on commit c0f15c5

Please sign in to comment.