Order first by length field filled by sequence
issue11638 review437311003
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user