Skip to content
Permalink
Browse files

[IMP] 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 953d446a998e446d05236dd42c03c7104a4dadb5
Showing with 4 additions and 0 deletions.
  1. +1 −0 addons/mrp/models/mrp_production.py
  2. +3 −0 addons/mrp/models/mrp_workorder.py
@@ -583,6 +583,7 @@ def _workorders_create(self, bom, bom_data):
})
if workorders:
workorders[-1].next_work_order_id = workorder.id
workorders[-1]._init_nextworkorder_states()
workorders += workorder

# assign moves; last operation receive all unassigned moves (which case ?)
@@ -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 953d446

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