Order first by length field filled by sequence

issue11638
review437311003
This commit is contained in:
Cédric Krier committed 2022-09-14 19:27:28 +02:00
1 parent 2f5a197c3a
commit 2f35a7b9b8
1 file changed
+6
+6
View File
@@ -5,6 +5,7 @@ from functools import wraps
from itertools import groupby
from sql.conditionals import Case
from sql.functions import CharLength
from trytond.i18n import gettext
from trytond.model import ModelSQL, ModelView, Workflow, fields
@@ -165,6 +166,11 @@ class Quotation(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')