[FIX] procurement_jit_stock: Cancelled MO
To avoid running procurement in exception or cancel state. Before the fix: After cancelling a MO, when recreating the delivery order linked to the sale order in state "Shipping Exception" the system generated 2 more copies of MO (1 Extra) instead of just one for the cancelled MO. After the fix: Just one MO is recreated for the cancelled MO. opw:650395
This commit is contained in:
parent
8d4ca3d787
commit
a8fa06867b
|
@ -29,7 +29,7 @@ class procurement_order(osv.osv):
|
|||
context = dict(context or {}, procurement_autorun_defer=True)
|
||||
res = super(procurement_order, self).run(cr, uid, ids, autocommit=autocommit, context=context)
|
||||
|
||||
procurement_ids = self.search(cr, uid, [('move_dest_id.procurement_id', 'in', ids)], order='id', context=context)
|
||||
procurement_ids = self.search(cr, uid, [('move_dest_id.procurement_id', 'in', ids), ('state', 'not in', ['exception', 'cancel'])], order='id', context=context)
|
||||
|
||||
if procurement_ids:
|
||||
return self.run(cr, uid, procurement_ids, autocommit=autocommit, context=context)
|
||||
|
|
Loading…
Reference in New Issue