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
This commit is contained in:
Cédric Krier committed 2025-05-13 18:49:32 +02:00
1 parent b708094026
commit 593c8f0aea
1 file changed
+5 -3
+5 -3
View File
@@ -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})