From 593c8f0aea4b1494e85729a13d16078dd1fa8a4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 13 May 2025 18:49:32 +0200 Subject: [PATCH] Use AND-ed clause when searching for implicit location for internal shipment 88978685 added a clause on the type but using an OR-ed clause which includes all the storage locations instead of only the storage location with a provisioning or overflowing location. Closes #14016 --- modules/stock_supply/shipment.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/stock_supply/shipment.py b/modules/stock_supply/shipment.py index d4156f8ce6..08963828fd 100644 --- a/modules/stock_supply/shipment.py +++ b/modules/stock_supply/shipment.py @@ -63,9 +63,11 @@ class ShipmentInternal(ModelSQL, ModelView): (op.storage_location.id, op.product.id) ] = op id2location[op.storage_location.id] = op.storage_location - implicit_locations = Location.search(['OR', - ('provisioning_location', '!=', None), - ('overflowing_location', '!=', None), + implicit_locations = Location.search([ + ['OR', + ('provisioning_location', '!=', None), + ('overflowing_location', '!=', None), + ], ('type', '=', 'storage'), ]) id2location.update({l.id: l for l in implicit_locations})