From b492c982f222969adef5aa540a43a51d2de4e77c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 11 Oct 2022 22:48:36 +0200 Subject: [PATCH] Use all moves from internal shipment to compute incoming In request and draft state, the outgoing moves are not yet filled. issue11745 --- stock.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stock.py b/stock.py index cc5132fc8b..0519c0b9f4 100644 --- a/stock.py +++ b/stock.py @@ -472,8 +472,9 @@ class QuantityEarlyPlan(Workflow, ModelSQL, ModelView): shipment = self.origin if (shipment.to_location.warehouse == warehouse or shipment.from_location.warehouse != warehouse): - for move in shipment.outgoing_moves: - yield move.product, move.internal_quantity + for move in shipment.moves: + if move.to_location.warehouse == warehouse: + yield move.product, move.internal_quantity @classmethod def _pick_incoming(cls, quantity, plans):