From 7e0a5db4acc686d8ab36af4e70f31bf6b890e467 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 --- 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 f36e8cc478..72eaea9aa0 100644 --- a/trytond/report/report.py +++ b/trytond/report/report.py @@ -9,6 +9,7 @@ import os import subprocess import tempfile import time +import unicodedata import warnings import zipfile from email.mime.multipart import MIMEMultipart @@ -174,7 +175,8 @@ class Report(URLMixin, PoolBase): 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)