Skip to content
Permalink
Browse files

mrp: start work orders in the right state

To be able to override the initialisation of the work orders states,
we put that in a function.

opw 1943674
  • Loading branch information...
len-odoo committed Mar 21, 2019
1 parent 208b8eb commit c0d4f0f79158c903d4c84f63c0181821c1e3f09d
Showing with 4 additions and 1 deletion.
  1. +1 −1 addons/mrp/models/mrp_production.py
  2. +3 −0 addons/mrp/models/mrp_workorder.py
@@ -577,7 +577,7 @@ def _workorders_create(self, bom, bom_data):
'workcenter_id': operation.workcenter_id.id,
'operation_id': operation.id,
'duration_expected': duration_expected,
'state': len(workorders) == 0 and 'ready' or 'pending',
'state': len(workorders) == 0 and 'ready' or workorders[-1]._init_nextworkorder_states(),
'qty_producing': quantity,
'capacity': operation.workcenter_id.capacity,
})
@@ -414,6 +414,9 @@ def _start_nextworkorder(self):
if record.next_work_order_id.state == 'pending':
record.next_work_order_id.state = 'ready'

def _init_nextworkorder_states(self):
return 'pending'

@api.multi
def button_start(self):
self.ensure_one()

0 comments on commit c0d4f0f

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