From c72352d667d5a3b8e4972f5cafbb4a031ddaa379 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 24 Sep 2018 12:49:17 +0000 Subject: [PATCH] [FIX] stock: Not possible to cancel a pick - Set the Outgoing shipping of your warehouse to pick + pack + ship - Create a SO with a stockable product and validate it - Set the qty done to 1 in the ship and validate it - Cancel the pack Bug: It was impossible to cancel the pick. opw:1887098 closes odoo/odoo#27193 --- addons/stock/models/stock_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index 6343dbb79af..fb08a82bb81 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -1021,7 +1021,7 @@ class StockMove(models.Model): if move.propagate: # only cancel the next move if all my siblings are also cancelled if all(state == 'cancel' for state in siblings_states): - move.move_dest_ids._action_cancel() + move.move_dest_ids.filtered(lambda m: m.state != 'done')._action_cancel() else: if all(state in ('done', 'cancel') for state in siblings_states): move.move_dest_ids.write({'procure_method': 'make_to_stock'})