diff --git a/account.py b/account.py index a3fe3567e3..c2ad07fc1c 100644 --- a/account.py +++ b/account.py @@ -4,6 +4,8 @@ from decimal import ROUND_DOWN, ROUND_HALF_EVEN, Decimal from itertools import groupby from operator import itemgetter +from sql.functions import CharLength + from trytond import backend from trytond.i18n import gettext from trytond.model import MatchMixin, ModelSQL, ModelView, Workflow, fields @@ -197,6 +199,11 @@ class LandedCost(Workflow, ModelSQL, ModelView, MatchMixin): [sql_table.state], ['cancelled'], where=sql_table.state == 'cancel')) + @classmethod + def order_number(cls, tables): + table, _ = tables[None] + return [CharLength(table.number), table.number] + @staticmethod def default_company(): return Transaction().context.get('company')