diff --git a/stock.py b/stock.py index 61178dc3f0..32002329cd 100644 --- a/stock.py +++ b/stock.py @@ -1,6 +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 sql.conditionals import Case from trytond.model import fields from trytond.pyson import Not, Eval, Bool @@ -40,4 +41,4 @@ class Location: @staticmethod def order_sequence(tables): table, _ = tables[None] - return [table.sequence == Null, table.sequence] + return [Case((table.sequence == Null, 0), else_=1), table.sequence]