Order first by length field filled by sequence

issue11638
review437311003
This commit is contained in:
Cédric Krier
2022-09-14 19:27:28 +02:00
parent 2a0f51d4a5
commit 553ded1fd3
+6
View File
@@ -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'