From e5e058994e2ba0b89681c9ee73f8553e4b4aa240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Tarroja=20Caubet?= Date: Sat, 18 Dec 2021 01:37:06 +0100 Subject: [PATCH] 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) --HG-- branch : 6.0 --- trytond/report/report.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trytond/report/report.py b/trytond/report/report.py index 9036f1b550..0ef40ccb99 100644 --- a/trytond/report/report.py +++ b/trytond/report/report.py @@ -9,6 +9,7 @@ import math import subprocess import tempfile import time +import unicodedata import warnings import zipfile import operator @@ -163,7 +164,8 @@ class Report(URLMixin, PoolBase): - len(str(record_count)) - 2) for record in records[:5]: 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)