Order operations by sequence or id in case is None

#060064
This commit is contained in:
Raimon Esteve 2022-08-19 15:57:09 +02:00
parent 3c59962849
commit e412e9e695
1 changed files with 4 additions and 1 deletions

View File

@ -266,7 +266,10 @@ class Production(metaclass=PoolMeta):
'readonly': ~Eval('state').in_(['request', 'draft']),
})
operations = fields.One2Many('production.operation', 'production',
'Operations', order=[('sequence', 'ASC')], states={
'Operations', order=[
('sequence', 'ASC'),
('id', 'ASC'),
], states={
'readonly': Eval('state') == 'done',
})