diff --git a/opportunity.py b/opportunity.py index 18d557b8fb..601d8e7143 100644 --- a/opportunity.py +++ b/opportunity.py @@ -5,6 +5,7 @@ import datetime from itertools import groupby from sql import Null +from sql.functions import CharLength from trytond.i18n import gettext from trytond.ir.attachment import AttachmentCopyMixin @@ -236,6 +237,11 @@ class SaleOpportunity( }, }) + @classmethod + def order_number(cls, tables): + table, _ = tables[None] + return [CharLength(table.number), table.number] + @staticmethod def default_state(): return 'lead'