From c1be38f14d08b205eb7ffb07fec55f503f17d48a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 14 Aug 2026 11:55:48 +0200 Subject: [PATCH] Use BIGINT for table query with composed unique ID When the maximal id of the table is too big, int4 is not enough like #15010 shows. --- modules/sale/sale_reporting.py | 10 ++++++++++ modules/stock/stock_reporting_margin.py | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/modules/sale/sale_reporting.py b/modules/sale/sale_reporting.py index d308305a3e..a8e0c5a7d2 100644 --- a/modules/sale/sale_reporting.py +++ b/modules/sale/sale_reporting.py @@ -372,6 +372,11 @@ class CustomerCategoryMixin: __slots__ = () category = fields.Many2One('party.category', "Category") + @classmethod + def __setup__(cls): + super().__setup__() + cls.id._sql_type = 'BIGINT' + @classmethod def _joins(cls): pool = Pool() @@ -605,6 +610,11 @@ class ProductCategoryMixin(object): }, depends={'company'}) + @classmethod + def __setup__(cls): + super().__setup__() + cls.id._sql_type = 'BIGINT' + @classmethod def _joins(cls): pool = Pool() diff --git a/modules/stock/stock_reporting_margin.py b/modules/stock/stock_reporting_margin.py index 622bec83b8..59ef9aba61 100644 --- a/modules/stock/stock_reporting_margin.py +++ b/modules/stock/stock_reporting_margin.py @@ -430,6 +430,11 @@ class CategoryMixin: category = fields.Many2One('product.category', "Category") + @classmethod + def __setup__(cls): + super().__setup__() + cls.id._sql_type = 'BIGINT' + @classmethod def _joins(cls): pool = Pool()