Help

0

V16 - Manufacturing Unplan MO

Avatar
Jay Whittington

I have an MO that I have clicked the PLAN button on. I want to UNPLAN the MO, due to not having the materials for the job. However i cannot do this UNPLAN because

"Some work orders have already started, you cannot unplan this manufacturing order."

This appears to be related to the status of the first step on the MO router which changed from "Waiting" to "In Progress" when I clicked the PLAN button.


Is there a way to set the status back to "waiting" and then unplan the MO?


The only work around i have found is to delete the router step, unplan the job, then add the router step back in, which is prone to human error.


What am i missing here?

 

1 Comment
Avatar
Discard
Avatar
Jay Whittington
-

Worked perfectly, thank you Hamid!

1 Answer
0
Avatar
Hamid Ahmadimoghaddam
Best Answer

Hi Jay,

  • create a server action with:
    • model: production order
    • Action To Do: Execute Python Code
    • add the code below: (the server action can be applied on many MOs at once.)
for rec in records:
for work_order in rec.workorder_ids:
work_order['state'] = 'ready'
for move in rec.move_raw_ids:
move['quantity_done'] = 0
rec.button_unplan()
rec.write({
'qty_producing': 0,
'state': 'confirmed'
})
  • Click on "Add Contextual Action"
  • You will have:


  • Go to the Manufacturing Order that you want to unplan
  • Click on "Actions" > "Unplan MOs" (the name that you give to your server action)



  • the Workorders are back to waiting and the MO is unplanned and back to the state "confirmed".


Best regards,

Hamid - bitigloo GmbH

Avatar
Discard