diff --git a/purchase.py b/purchase.py index 8093e3b944..552a113216 100644 --- a/purchase.py +++ b/purchase.py @@ -3,6 +3,8 @@ from decimal import Decimal from itertools import chain +from sql.functions import CharLength + from trytond import backend from trytond.i18n import gettext from trytond.model import ( @@ -213,6 +215,11 @@ class PurchaseRequisition(Workflow, ModelSQL, ModelView): [table.state], ['cancelled'], where=table.state == 'cancel')) + @classmethod + def order_number(cls, tables): + table, _ = tables[None] + return [CharLength(table.number), table.number] + @classmethod def default_state(cls): return 'draft' diff --git a/setup.py b/setup.py index a96c2f7be2..a412c56ced 100755 --- a/setup.py +++ b/setup.py @@ -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))