Skip to content
Browse files

[FIX] mrp: start the next workorder in a function to allow for overrides

When a workorder is processed, it starts the next workorder.
We put that logic in a function to allow other modules to override it.

opw 1943674
  • Loading branch information...
len-odoo committed Mar 11, 2019
1 parent 8a7dc81 commit 208b8ebdb0799b78bcb107d73502d3e71a4659b2
Showing with 7 additions and 2 deletions.
  1. +7 −2 addons/mrp/models/
@@ -338,8 +338,7 @@ def record_production(self):
move_line.done_wo = True

# One a piece is produced, you can launch the next work order
if self.next_work_order_id.state == 'pending':
self.next_work_order_id.state = 'ready'

lambda move_line: not move_line.done_move and not move_line.lot_produced_id and move_line.qty_done > 0
@@ -409,6 +408,12 @@ def record_production(self):
return True

def _start_nextworkorder(self):
for record in self:
if record.next_work_order_id.state == 'pending':
record.next_work_order_id.state = 'ready'

def button_start(self):

0 comments on commit 208b8eb

Please sign in to comment.
You can’t perform that action at this time.