details: https://code.tryton.org/tryton/commit/0d8ca8201d1b
branch: default
user: Cédric Krier <[email protected]>
date: Mon Aug 03 12:26:11 2026 +0200
description:
Fill code compact in party identifier history table
Closes #14983
diffstat:
modules/account_invoice_history/party.py | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diffs (31 lines):
diff -r 72376d43b60f -r 0d8ca8201d1b modules/account_invoice_history/party.py
--- a/modules/account_invoice_history/party.py Fri Jul 24 14:39:41 2026 +0200
+++ b/modules/account_invoice_history/party.py Mon Aug 03 12:26:11 2026 +0200
@@ -1,6 +1,7 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.pool import PoolMeta
+from trytond.transaction import Transaction
class Party(metaclass=PoolMeta):
@@ -16,3 +17,19 @@
class Identifier(metaclass=PoolMeta):
__name__ = 'party.identifier'
_history = True
+
+ @classmethod
+ def __register__(cls, module_name):
+ cursor = Transaction().connection.cursor()
+ table = cls.__table_history__()
+ table_h = cls.__table_handler__(module_name=module_name, history=True)
+
+ fill_code_compact = (
+ table_h.column_exist('code')
+ and not table_h.column_exist('code_compact'))
+
+ super().__register__(module_name)
+
+ # Migration from 7.8: Fill code_compact
+ if fill_code_compact:
+ cursor.execute(*table.update([table.code_compact], [table.code]))