From 3532ca99b3d586c5b0471457b9be2185a228b6f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 14 Jun 2015 18:37:04 +0200 Subject: [PATCH] Add missing order override for sequence field issue4795 review15451002 --- product.py | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/product.py b/product.py index 33bcb8847e..bb1138ad08 100644 --- a/product.py +++ b/product.py @@ -1,5 +1,7 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. +from sql import Null + from trytond.model import ModelView, ModelSQL, fields from trytond.pyson import Eval, Get, If, Bool from trytond.pool import PoolMeta @@ -83,3 +85,8 @@ class ProductBom(ModelSQL, ModelView): @classmethod def search_rec_name(cls, name, clause): return [('bom.rec_name',) + tuple(clause[1:])] + + @staticmethod + def order_sequence(tables): + table, _ = tables[None] + return [table.sequence == Null, table.sequence] diff --git a/setup.py b/setup.py index 448b01c93b..7dfa96e6bb 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ if minor_version % 2: 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( name[8:], name, version)) -requires = [] +requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): if not re.match(r'(ir|res|webdav)(\W|$)', dep): requires.append(get_require_version('trytond_%s' % dep))