Cast to integer reporting ID calculated using SQL Power

Closes #14732
This commit is contained in:
Cédric Krier
2026-04-09 18:24:39 +02:00
parent 4e97df25ba
commit 53bf0cefcd
2 changed files with 5 additions and 3 deletions
+3 -2
View File
@@ -403,7 +403,7 @@ class CustomerCategoryMixin:
# by using a number one order bigger.
nb_category = category.select(
Power(10, (Ceil(Log(Max(category.id))) + Literal(1))))
return Min(line.id * nb_category + party_category.id)
return cls.id.sql_cast(Min(line.id * nb_category + party_category.id))
@classmethod
def _group_by(cls, tables, withs):
@@ -643,7 +643,8 @@ class ProductCategoryMixin(object):
# by using number one order bigger.
nb_category = category.select(
Power(10, (Ceil(Log(Max(category.id))) + Literal(1))))
return Min(line.id * nb_category + template_category.id)
return cls.id.sql_cast(
Min(line.id * nb_category + template_category.id))
@classmethod
def _group_by(cls, tables, withs):
+2 -1
View File
@@ -468,7 +468,8 @@ class CategoryMixin:
# by using number one order bigger.
nb_category = category.select(
Power(10, (Ceil(Log(Max(category.id))) + Literal(1))))
return Min(move.id * nb_category + template_category.id)
return cls.id.sql_cast(
Min(move.id * nb_category + template_category.id))
@classmethod
def _group_by(cls, tables, withs):