Skip to Content
Menu
This question has been flagged
1 Reply
4881 Views

Hi,

I don't think it is the normal behaviour, let me explain.

I've made a Sales Order, this create manufacturing orders. (procurement on real time activate or not)

Then I will just cancel this Sales order. Manufacturing orders previously created by this Sales Order aren't cancel.

 

The normal behaviour must be : Sales Order cancel => Manufacturing orders attached cancelled

Avatar
Discard
Best Answer

The normal behavior is just like that, when you cancel the Sale Order (SO) that originated the Manufactoring Order (MO), the MO will not cancel by itself. This happens because in a big company, the Sales department and Manufactoring department are separated, and they might already have started the MO (The SO was confirmed before).

This happens the same in Delivery Orders, that have to be cancelled before cancelling the Order that generated it.

Avatar
Discard
Author

Thanks for the answer, but if the manufacturing order isn't start yet why openerp can't cancel it ? Or forced us to cancel manufacturing order before like it does with Delivery Orders ?

I am wondering about this as well for v15. I can imagine customization that would do this.

Something like (pseudo code):

@api.model
def write(self, vals):
res = super(ProductTemplate, self).write(vals)

if 'some_canceled_state_field' in values and values['some_canceled_state_field']:
# find mo's and cancel them with their cancel method.
mfg_order = self.env["the.mfg.order.model.name"].search([("origin", "ilike", order_name)])
for order in mfg_orders:
#cancel them
order.cancel()
return res

Surely someone has written one up that could share it here.

Related Posts Replies Views Activity
1
Mar 15
4404
2
Mar 15
6211
0
Mar 15
3537
2
Oct 25
437
1
Mar 21
2712