Add test on domain of relation fields
issue10794 review383081002
This commit is contained in:
1 parent
d545841317
commit
22cbe8bf3d
2 files changed
+7
-7
No files matched your search
+5
-5
@@ -122,8 +122,8 @@ class Production(ShipmentAssignMixin, Workflow, ModelSQL, ModelView):
|
||||
inputs = fields.One2Many('stock.move', 'production_input', 'Inputs',
|
||||
domain=[
|
||||
('shipment', '=', None),
|
||||
('from_location', 'child_of', [Eval('warehouse')], 'parent'),
|
||||
('to_location', '=', Eval('location')),
|
||||
('from_location', 'child_of', [Eval('warehouse', -1)], 'parent'),
|
||||
('to_location', '=', Eval('location', -1)),
|
||||
('company', '=', Eval('company', -1)),
|
||||
],
|
||||
states={
|
||||
@@ -134,10 +134,10 @@ class Production(ShipmentAssignMixin, Workflow, ModelSQL, ModelView):
|
||||
outputs = fields.One2Many('stock.move', 'production_output', 'Outputs',
|
||||
domain=[
|
||||
('shipment', '=', None),
|
||||
('from_location', '=', Eval('location')),
|
||||
('from_location', '=', Eval('location', -1)),
|
||||
['OR',
|
||||
('to_location', 'child_of', [Eval('warehouse')], 'parent'),
|
||||
('to_location.waste_warehouses', '=', Eval('warehouse')),
|
||||
('to_location', 'child_of', [Eval('warehouse', -1)], 'parent'),
|
||||
('to_location.waste_warehouses', '=', Eval('warehouse', -1)),
|
||||
],
|
||||
('company', '=', Eval('company', -1)),
|
||||
],
|
||||
|
||||
@@ -23,7 +23,7 @@ class Location(metaclass=PoolMeta):
|
||||
},
|
||||
domain=[
|
||||
('type', '=', 'storage'),
|
||||
('parent', 'child_of', [Eval('id')]),
|
||||
('parent', 'child_of', [Eval('id', -1)]),
|
||||
],
|
||||
depends=['type', 'id'],
|
||||
help="Where the production components are picked from.\n"
|
||||
@@ -35,7 +35,7 @@ class Location(metaclass=PoolMeta):
|
||||
},
|
||||
domain=[
|
||||
('type', '=', 'storage'),
|
||||
('parent', 'child_of', [Eval('id')]),
|
||||
('parent', 'child_of', [Eval('id', -1)]),
|
||||
],
|
||||
depends=['type', 'id'],
|
||||
help="Where the produced goods are stored.\n"
|
||||
|
||||
Reference in new issue
Block a user