Remove boolean expression in order
issue4852 review15541002
This commit is contained in:
1 parent
df298abf0e
commit
abaa3ac63e
2 files changed
+5
-3
No files matched your search
+3
-2
@@ -4,6 +4,7 @@ import datetime
|
||||
|
||||
from sql import Literal, Null
|
||||
from sql.aggregate import Count
|
||||
from sql.conditionals import Case
|
||||
|
||||
from trytond.model import ModelView, ModelSQL, MatchMixin, fields
|
||||
from trytond.pyson import Eval, If
|
||||
@@ -222,7 +223,7 @@ class ProductSupplier(ModelSQL, ModelView, MatchMixin):
|
||||
@staticmethod
|
||||
def order_sequence(tables):
|
||||
table, _ = tables[None]
|
||||
return [table.sequence == Null, table.sequence]
|
||||
return [Case((table.sequence == Null, 0), else_=1), table.sequence]
|
||||
|
||||
@staticmethod
|
||||
def default_company():
|
||||
@@ -331,7 +332,7 @@ class ProductSupplierPrice(ModelSQL, ModelView, MatchMixin):
|
||||
@staticmethod
|
||||
def order_sequence(tables):
|
||||
table, _ = tables[None]
|
||||
return [table.sequence == Null, table.sequence]
|
||||
return [Case((table.sequence == Null, 0), else_=1), table.sequence]
|
||||
|
||||
@staticmethod
|
||||
def default_quantity():
|
||||
|
||||
+2
-1
@@ -8,6 +8,7 @@ from sql import Table, Literal, Null
|
||||
from sql.functions import Overlay, Position
|
||||
from sql.aggregate import Count
|
||||
from sql.operators import Concat
|
||||
from sql.conditionals import Case
|
||||
|
||||
from trytond.model import Workflow, ModelView, ModelSQL, fields
|
||||
from trytond.modules.company import CompanyReport
|
||||
@@ -990,7 +991,7 @@ class PurchaseLine(ModelSQL, ModelView):
|
||||
@staticmethod
|
||||
def order_sequence(tables):
|
||||
table, _ = tables[None]
|
||||
return [table.sequence == Null, table.sequence]
|
||||
return [Case((table.sequence == Null, 0), else_=1), table.sequence]
|
||||
|
||||
@staticmethod
|
||||
def default_type():
|
||||
|
||||
Reference in new issue
Block a user