From e3b6c3559dffbf03efdc1c4a9cd8be124630fc3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 18 Feb 2019 18:34:32 +0100 Subject: [PATCH] Do not pick product at the destination location It is forbidden to create move with the same source and destination locations. To avoid this case, we remove the destination location from the quantities to pick. issue7856 review66541002 --- move.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/move.py b/move.py index 4d536626b7..76c91532e6 100644 --- a/move.py +++ b/move.py @@ -881,6 +881,8 @@ class Move(Workflow, ModelSQL, ModelView): location_qties[location] = Uom.compute_qty( move.product.default_uom, pbl[key], move.uom, round=False) + # Prevent to pick from the destination location + location_qties.pop(move.to_location, None) to_pick = move.pick_product(location_qties)