[FIX] purchase: internal transfer wait operation when RFQ canceled

When you have a receipt in multiple steps and cancel the generated RFQ
the following internal move stay in waiting another operation.

We recompute its state and pass it in waiting.

OPW-1832176
This commit is contained in:
Pierre Masereel
2018-03-29 13:53:25 +02:00
parent 5c2b42bbf7
commit 7560bb7f42
+1
View File
@@ -372,6 +372,7 @@ class PurchaseOrder(models.Model):
siblings_states = (order_line.move_dest_ids.mapped('move_orig_ids')).mapped('state')
if all(state in ('done', 'cancel') for state in siblings_states):
order_line.move_dest_ids.write({'procure_method': 'make_to_stock'})
order_line.move_dest_ids._recompute_state()
for pick in order.picking_ids.filtered(lambda r: r.state != 'cancel'):
pick.action_cancel()