Order first by length field filled by sequence
issue11638 review437311003
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
from collections import defaultdict
|
||||
from decimal import Decimal
|
||||
|
||||
from sql.functions import CharLength
|
||||
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import (
|
||||
DeactivableMixin, ModelSQL, ModelView, Workflow, fields)
|
||||
@@ -187,6 +189,11 @@ class Complaint(Workflow, ModelSQL, ModelView):
|
||||
'account.invoice.line': ['credit_note'],
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def order_number(cls, tables):
|
||||
table, _ = tables[None]
|
||||
return [CharLength(table.number), table.number]
|
||||
|
||||
@staticmethod
|
||||
def default_date():
|
||||
pool = Pool()
|
||||
|
||||
Reference in New Issue
Block a user