From 553ded1fd3e8763890e75700613a429017e5463b 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 --- opportunity.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/opportunity.py b/opportunity.py index 18d557b8fb..601d8e7143 100644 --- a/opportunity.py +++ b/opportunity.py @@ -5,6 +5,7 @@ import datetime from itertools import groupby from sql import Null +from sql.functions import CharLength from trytond.i18n import gettext from trytond.ir.attachment import AttachmentCopyMixin @@ -236,6 +237,11 @@ class SaleOpportunity( }, }) + @classmethod + def order_number(cls, tables): + table, _ = tables[None] + return [CharLength(table.number), table.number] + @staticmethod def default_state(): return 'lead'