From bd350be3f8302e5ea7836ab63c7c19b5bbc128f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 16 Jul 2026 11:03:16 +0200 Subject: [PATCH] Enforce shipment domain on stock moves On shipment where moves are split into two fields, we must enforce at least one of the domain of each field. --- modules/stock/shipment.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/stock/shipment.py b/modules/stock/shipment.py index 0118ffaec8..4bb84738e6 100644 --- a/modules/stock/shipment.py +++ b/modules/stock/shipment.py @@ -473,7 +473,6 @@ class ShipmentIn( 'get_inventory_moves', setter='set_inventory_moves') moves = fields.One2Many( 'stock.move', 'shipment', "Moves", - domain=[('company', '=', Eval('company', -1))], states={ 'readonly': True, }) @@ -532,6 +531,10 @@ class ShipmentIn( 'depends': ['state'], }, }) + cls.moves.domain = ['OR', + cls.incoming_moves.domain, + cls.inventory_moves.domain, + ] @classmethod def __register__(cls, module_name): @@ -1265,7 +1268,6 @@ class ShipmentOut( 'get_inventory_moves', setter='set_inventory_moves') moves = fields.One2Many( 'stock.move', 'shipment', "Moves", - domain=[('company', '=', Eval('company', -1))], states={ 'readonly': True, }) @@ -1387,6 +1389,10 @@ class ShipmentOut( 'assign_try': {}, 'assign_force': {}, }) + cls.moves.domain = ['OR', + cls.outgoing_moves.domain, + cls.inventory_moves.domain, + ] @classmethod def __register__(cls, module_name): @@ -1963,7 +1969,6 @@ class ShipmentOutReturn( 'get_inventory_moves', setter='set_inventory_moves') moves = fields.One2Many( 'stock.move', 'shipment', "Moves", - domain=[('company', '=', Eval('company', -1))], states={ 'readonly': True, }) @@ -2020,6 +2025,10 @@ class ShipmentOutReturn( 'depends': ['state'], }, }) + cls.moves.domain = ['OR', + cls.incoming_moves.domain, + cls.inventory_moves.domain, + ] @classmethod def __register__(cls, module_name):