Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
4625 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Autor

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.

Publicaciones relacionadas Respuestas Vistas Actividad
1
mar 15
4121
2
mar 15
5940
0
mar 15
3286
1
mar 21
2519
0
mar 15
3036