details:   https://code.tryton.org/tryton/commit/7ac3bc0da7c0
branch:    7.8
user:      Cédric Krier <[email protected]>
date:      Tue Feb 24 09:19:16 2026 +0100
description:
        Use length of the name field of translation as fallback of substring

        Closes #14623
        (grafted from e5b340d466415b9fd383e4f5e94708860994aedb)
diffstat:

 trytond/trytond/ir/translation.py |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 9979a0f44ab0 -r 7ac3bc0da7c0 trytond/trytond/ir/translation.py
--- a/trytond/trytond/ir/translation.py Sat Feb 28 12:57:24 2026 +0100
+++ b/trytond/trytond/ir/translation.py Tue Feb 24 09:19:16 2026 +0100
@@ -13,7 +13,7 @@
 from sql import Column, Literal, Null
 from sql.aggregate import Max
 from sql.conditionals import Case
-from sql.functions import Position, Substring
+from sql.functions import CharLength, Position, Substring
 
 import trytond.config as config
 from trytond.cache import Cache
@@ -307,7 +307,7 @@
                             Case((
                                     Position(',', table.name) > 0,
                                     Position(',', table.name) - 1),
-                                else_=0)), value)))]
+                                else_=CharLength(table.name))), value)))]
 
     @classmethod
     def get_language(cls):

Reply via email to