[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:
Pierre Masereel
2018-06-26 15:02:51 +02:00
committed by Goffin Simon
parent 24f18e995e
commit f6b3247c31
+2
View File
@@ -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