Cast to integer reporting ID calculated using SQL Power

Closes #14732
(grafted from 2119eb22022587466530ff1221b13397c660cfaf)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier
2026-04-09 18:24:39 +02:00
parent ec5fe27162
commit dc1e12ca3a
2 changed files with 5 additions and 3 deletions
+3 -2
View File
@@ -417,7 +417,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):
@@ -664,7 +664,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
@@ -482,7 +482,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):