diff --git a/purchase.py b/purchase.py index 09504608b3..46e45e77b8 100644 --- a/purchase.py +++ b/purchase.py @@ -5,6 +5,7 @@ from functools import wraps from itertools import groupby from sql.conditionals import Case +from sql.functions import CharLength from trytond.i18n import gettext from trytond.model import ModelSQL, ModelView, Workflow, fields @@ -165,6 +166,11 @@ class Quotation(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')