From 23de80c5f64ff64bc5513e099f83bb379c981ed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 14 Sep 2022 19:27:28 +0200 Subject: [PATCH] Order first by length field filled by sequence issue11638 review437311003 --- account.py | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/account.py b/account.py index 5b9e2af6f1..2779b8023e 100644 --- a/account.py +++ b/account.py @@ -3,6 +3,8 @@ from decimal import Decimal from itertools import groupby +from sql.functions import CharLength + from trytond.i18n import gettext from trytond.model import ModelSQL, ModelView, Workflow, fields from trytond.modules.company.model import CompanyValueMixin @@ -149,6 +151,11 @@ class ShipmentCost(Workflow, ModelSQL, ModelView): }, }) + @classmethod + def order_number(cls, tables): + table, _ = tables[None] + return [CharLength(table.number), table.number] + @classmethod def default_company(cls): return Transaction().context.get('company') diff --git a/setup.py b/setup.py index 6f355b8e89..c6004619ff 100755 --- a/setup.py +++ b/setup.py @@ -61,7 +61,7 @@ else: break if local_version: version += '+' + '.'.join(local_version) -requires = [] +requires = ['python-sql'] for dep in info.get('depends', []): if not re.match(r'(ir|res)(\W|$)', dep): requires.append(get_require_version('trytond_%s' % dep))