Do not apply domain in advance state for production_location field.

This commit refs #28835
This commit is contained in:
Sergio Morillo 2023-10-25 15:32:40 +02:00
parent 8058d282ab
commit 5925cd7a88
1 changed files with 7 additions and 4 deletions

View File

@ -129,10 +129,13 @@ class UnitLoad(ModelSQL, ModelView):
'on_change_with_warehouse_production')
production_location = fields.Many2One('stock.location',
'Production location', select=True,
domain=[('type', '=', 'production'),
If(Bool(Eval('warehouse')),
('parent', 'child_of', Eval('warehouse_production')),
())],
domain=[
('type', '=', 'production'),
If(Bool(Eval('warehouse')
& (Eval('production_state') == 'running')),
('parent', 'child_of', Eval('warehouse_production')),
())
],
states={
'readonly': (Eval('state') != 'draft') | (
Eval('production_state') == 'done'),