Order first by length field filled by sequence
issue11638 review437311003
This commit is contained in:
1 parent
33f7b5108d
commit
23de80c5f6
2 files changed
+8
-1
No files matched your search
@@ -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')
|
||||
|
||||
Reference in new issue
Block a user