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 c08a844096
commit bc1b63f1e5
2 changed files with 8 additions and 1 deletions
+7
View File
@@ -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()
+1 -1
View File
@@ -58,7 +58,7 @@ else:
if local_version:
version += '+' + '.'.join(local_version)
requires = []
requires = ['python-sql']
for dep in info.get('depends', []):
if not re.match(r'(ir|res)(\W|$)', dep):
requires.append(get_require_version('trytond_%s' % dep))