changeset 205b4030b93c in trytond:6.2
details: https://hg.tryton.org/trytond?cmd=changeset&node=205b4030b93c
description:
        Use normalized length of record name

        This is needed in case the client normalize the report name before 
storing to
        the filesystem.

        issue10986
        review381471003
        (grafted from 970256a66ba01885af777a2fe13052f9664ba4c1)
diffstat:

 trytond/report/report.py |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r 8f0eb6f2e910 -r 205b4030b93c trytond/report/report.py
--- a/trytond/report/report.py  Thu Dec 16 22:12:42 2021 +0100
+++ b/trytond/report/report.py  Sat Dec 18 01:37:06 2021 +0100
@@ -9,6 +9,7 @@
 import subprocess
 import tempfile
 import time
+import unicodedata
 import warnings
 import zipfile
 import operator
@@ -173,7 +174,8 @@
                     record_name = template.generate(record=record).render()
                 else:
                     record_name = record.rec_name
-                name_length += len(record_name) + 1
+                name_length += len(
+                    unicodedata.normalize('NFKD', record_name)) + 1
                 if name_length > max_length:
                     break
                 names.append(record_name)

Reply via email to