From d7c6033f99bdae6392e5ae96af32193e6fe27b06 Mon Sep 17 00:00:00 2001 From: dbkosky Date: Thu, 14 Apr 2022 15:08:02 +0000 Subject: [PATCH] [FIX] l10n_it_edi: format_alphanumeric The Italian edi system accepts utf-8 encoded documents, but actually the contents of the fields have to be latin-1 encoded. Format-alphanumeric should remove any non-latin1 characters and replace them with a ? Several fields to are also truncated before the function is applied. This is so that these fields better match the specification. This will help to prevent edi rejections in the future. A test is also included to test with a few lines that should / should not be adapted in by the format_alphanumeric function. Along with the addition of the test, the test partner italian_partner_a's is_company field is changed to True, since the partner is a company. The expected xml has been altered to match the changes to partner_a. closes odoo/odoo#89494 Task-id: 2826424 X-original-commit: 712758fc2505abfa271636caaa8ba38436086f32 Signed-off-by: Josse Colpaert --- .../l10n_it_edi/data/invoice_it_template.xml | 48 ++++++------- addons/l10n_it_edi/models/account_invoice.py | 4 ++ .../expected_xmls/IT00470550013_basis.xml | 3 +- .../l10n_it_edi_sdicoop/tests/test_edi_xml.py | 70 +++++++++++++++++++ 4 files changed, 99 insertions(+), 26 deletions(-) diff --git a/addons/l10n_it_edi/data/invoice_it_template.xml b/addons/l10n_it_edi/data/invoice_it_template.xml index daf07495a4e..d028fb698d5 100644 --- a/addons/l10n_it_edi/data/invoice_it_template.xml +++ b/addons/l10n_it_edi/data/invoice_it_template.xml @@ -8,18 +8,18 @@ EAN - + INTERNAL - + - + - + @@ -36,9 +36,9 @@