details:   https://code.tryton.org/tryton/commit/e28ffb0ad70b
branch:    default
user:      Cédric Krier <[email protected]>
date:      Fri Aug 14 11:55:48 2026 +0200
description:
        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.
diffstat:

 modules/sale/sale_reporting.py          |  10 ++++++++++
 modules/stock/stock_reporting_margin.py |   5 +++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diffs (42 lines):

diff -r 00123388953e -r e28ffb0ad70b modules/sale/sale_reporting.py
--- a/modules/sale/sale_reporting.py    Wed Sep 02 13:57:21 2026 +0200
+++ b/modules/sale/sale_reporting.py    Fri Aug 14 11:55:48 2026 +0200
@@ -373,6 +373,11 @@
     category = fields.Many2One('party.category', "Category")
 
     @classmethod
+    def __setup__(cls):
+        super().__setup__()
+        cls.id._sql_type = 'BIGINT'
+
+    @classmethod
     def _joins(cls):
         pool = Pool()
         PartyCategory = pool.get('party.party-party.category')
@@ -606,6 +611,11 @@
         depends={'company'})
 
     @classmethod
+    def __setup__(cls):
+        super().__setup__()
+        cls.id._sql_type = 'BIGINT'
+
+    @classmethod
     def _joins(cls):
         pool = Pool()
         Product = pool.get('product.product')
diff -r 00123388953e -r e28ffb0ad70b modules/stock/stock_reporting_margin.py
--- a/modules/stock/stock_reporting_margin.py   Wed Sep 02 13:57:21 2026 +0200
+++ b/modules/stock/stock_reporting_margin.py   Fri Aug 14 11:55:48 2026 +0200
@@ -431,6 +431,11 @@
     category = fields.Many2One('product.category', "Category")
 
     @classmethod
+    def __setup__(cls):
+        super().__setup__()
+        cls.id._sql_type = 'BIGINT'
+
+    @classmethod
     def _joins(cls):
         pool = Pool()
         Product = pool.get('product.product')

Reply via email to