details: https://code.tryton.org/tryton/commit/1e6c3426d11d
branch: default
user: Cédric Krier <[email protected]>
date: Thu Jul 16 11:03:16 2026 +0200
description:
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.
diffstat:
modules/stock/shipment.py | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diffs (60 lines):
diff -r 273c2c256c1b -r 1e6c3426d11d modules/stock/shipment.py
--- a/modules/stock/shipment.py Thu Aug 20 12:02:57 2026 +0200
+++ b/modules/stock/shipment.py Thu Jul 16 11:03:16 2026 +0200
@@ -473,7 +473,6 @@
'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 @@
'depends': ['state'],
},
})
+ cls.moves.domain = ['OR',
+ cls.incoming_moves.domain,
+ cls.inventory_moves.domain,
+ ]
@classmethod
def __register__(cls, module_name):
@@ -1265,7 +1268,6 @@
'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 @@
'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 @@
'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 @@
'depends': ['state'],
},
})
+ cls.moves.domain = ['OR',
+ cls.incoming_moves.domain,
+ cls.inventory_moves.domain,
+ ]
@classmethod
def __register__(cls, module_name):