[FIX] purchase: remove move_dest_ids when PO line cancelled
When a PO is confirmed, cancelled, set back to draft and confirmed again, the push rules don't apply because the PO lines have move_dest_ids. So we remove those move_dest_ids from PO lines, to allow push rules to be applied on the newly confirmed PO. OPW-1859363
This commit is contained in:
committed by
Goffin Simon
parent
24f18e995e
commit
f6b3247c31
@@ -378,6 +378,8 @@ class PurchaseOrder(models.Model):
|
||||
for pick in order.picking_ids.filtered(lambda r: r.state != 'cancel'):
|
||||
pick.action_cancel()
|
||||
|
||||
order.order_line.write({'move_dest_ids':[(5,0,0)]})
|
||||
|
||||
self.write({'state': 'cancel'})
|
||||
|
||||
@api.multi
|
||||
|
||||
Reference in New Issue
Block a user