diff --git a/complaint.py b/complaint.py index c4a5f3aa50..ead206e2ee 100644 --- a/complaint.py +++ b/complaint.py @@ -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() diff --git a/setup.py b/setup.py index 2c2f5449c8..156b336bba 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))