From e412e9e69541e1226656e9fd09cfc51335b87d14 Mon Sep 17 00:00:00 2001 From: Raimon Esteve Date: Fri, 19 Aug 2022 15:57:09 +0200 Subject: [PATCH] Order operations by sequence or id in case is None #060064 --- operation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/operation.py b/operation.py index fc0a2b7..5b8990f 100644 --- a/operation.py +++ b/operation.py @@ -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', })