Allow to use storage location as input or output location
When the input or output location is the same as the storage location, it can be of type view.
This commit is contained in:
@@ -78,7 +78,10 @@ class Location(DeactivableMixin, tree(), ModelSQL, ModelView):
|
||||
'required': Eval('type') == 'warehouse',
|
||||
},
|
||||
domain=[
|
||||
('type', '=', 'storage'),
|
||||
['OR',
|
||||
('type', '=', 'storage'),
|
||||
('id', '=', Eval('storage_location', -1)),
|
||||
],
|
||||
['OR',
|
||||
('parent', 'child_of', [Eval('id', -1)]),
|
||||
('parent', '=', None),
|
||||
@@ -91,7 +94,10 @@ class Location(DeactivableMixin, tree(), ModelSQL, ModelView):
|
||||
'required': Eval('type') == 'warehouse',
|
||||
},
|
||||
domain=[
|
||||
('type', '=', 'storage'),
|
||||
['OR',
|
||||
('type', '=', 'storage'),
|
||||
('id', '=', Eval('storage_location', -1)),
|
||||
],
|
||||
['OR',
|
||||
('parent', 'child_of', [Eval('id', -1)]),
|
||||
('parent', '=', None)]],
|
||||
|
||||
@@ -185,7 +185,10 @@ class ShipmentIn(ShipmentMixin, Workflow, ModelSQL, ModelView):
|
||||
warehouse_input = fields.Many2One(
|
||||
'stock.location', "Warehouse Input", required=True,
|
||||
domain=[
|
||||
('type', '=', 'storage'),
|
||||
['OR',
|
||||
('type', '=', 'storage'),
|
||||
('id', '=', Eval('warehouse_storage', -1)),
|
||||
],
|
||||
If(Eval('state') == 'draft',
|
||||
('parent', 'child_of', [Eval('warehouse', -1)]),
|
||||
()),
|
||||
@@ -1079,7 +1082,10 @@ class ShipmentOut(ShipmentAssignMixin, Workflow, ModelSQL, ModelView):
|
||||
warehouse_output = fields.Many2One(
|
||||
'stock.location', "Warehouse Output", required=True,
|
||||
domain=[
|
||||
('type', '=', 'storage'),
|
||||
['OR',
|
||||
('type', '=', 'storage'),
|
||||
('id', '=', Eval('warehouse_output', -1)),
|
||||
],
|
||||
If(Eval('state') == 'draft',
|
||||
('parent', 'child_of', [Eval('warehouse', -1)]),
|
||||
()),
|
||||
@@ -1796,7 +1802,10 @@ class ShipmentOutReturn(ShipmentMixin, Workflow, ModelSQL, ModelView):
|
||||
warehouse_input = fields.Many2One(
|
||||
'stock.location', "Warehouse Input", required=True,
|
||||
domain=[
|
||||
('type', '=', 'storage'),
|
||||
['OR',
|
||||
('type', '=', 'storage'),
|
||||
('id', '=', Eval('warehouse_storage', -1)),
|
||||
],
|
||||
If(Eval('state') == 'draft',
|
||||
('parent', 'child_of', [Eval('warehouse', -1)]),
|
||||
()),
|
||||
|
||||
Reference in New Issue
Block a user