Order operations by sequence or id in case is None

#060064
This commit is contained in:
Raimon Esteve 2022-09-07 15:39:10 +02:00 committed by GitHub
parent f7aa1ac4bf
commit d0259a2503
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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',
})