From e3b0fa6d4251f1633b3e6e8e627cf6a7a9c456d8 Mon Sep 17 00:00:00 2001 From: Marco Colombo Date: Fri, 1 Oct 2021 12:54:15 +0200 Subject: [PATCH] [14.0][FIX] l10n_it_fatturapa_in: attachments were encoded two times Fixes #2398 --- l10n_it_fatturapa_in/models/attachment.py | 4 +--- l10n_it_fatturapa_in/tests/data/test.png | Bin 0 -> 13383 bytes .../tests/test_import_fatturapa_xml.py | 12 ++++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 l10n_it_fatturapa_in/tests/data/test.png diff --git a/l10n_it_fatturapa_in/models/attachment.py b/l10n_it_fatturapa_in/models/attachment.py index 1dae3d54e564..27e4eef300f1 100644 --- a/l10n_it_fatturapa_in/models/attachment.py +++ b/l10n_it_fatturapa_in/models/attachment.py @@ -1,5 +1,3 @@ -import base64 - from odoo import _, api, fields, models from odoo.tools import format_date @@ -135,7 +133,7 @@ def extract_attachments(self, AttachmentsData, invoice_id): content = attach.Attachment.encode() _attach_dict = { "name": name, - "datas": base64.b64encode(content), + "datas": content, "description": attach.DescrizioneAttachment or "", "compression": attach.AlgoritmoCompressione or "", "format": attach.FormatoAttachment or "", diff --git a/l10n_it_fatturapa_in/tests/data/test.png b/l10n_it_fatturapa_in/tests/data/test.png new file mode 100644 index 0000000000000000000000000000000000000000..ef62eaf95591dea77cc6db1542436b4e0b231a7d GIT binary patch literal 13383 zcmZ8|WmsEHwDrN=El@O2w75%gcS4K1yGskjiaQi{heC08El}J_vEmY3iu;%Me!uR` zlS!WB$2l|m?3r16tu>MAs&ZK9Wat0@U@6E;Ltx*Hu%?WP4Ey|vnIj7TJlG1-5+6Qg zpZI;wCK_ydZK?2Sd(1(?{T-1h63c0|-6c)%F9uKdgUKSvlElxnLDaDH2+;;JxAdXOHi`SVc`0i(NCU`OK#TkhgX;Yln42Se)U93-$l z!3`gtL3|FnrMt|P?vVmGHaW{R?joFWS;H>jl;PC%?$+jeFG~c0r#FHBD09UklLVO0 zDNj8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nio;&)`f%JSt%e|`4#sOLoq86FM^SUC9`nK&_l;0~Eou;e1BQr?R`@E|ilMZ`id zU>6u*3hi`6kcOcJR2i@{3VhHoVy$ZXXstJra|3%3(NJLGwF3-#!B7<9$mUqr+;o zBC#PU7xN$O#XANLH@V;Q^JqDooMu=1wEwuy*1Fy}ci+>ywPibjhQx704VXxwB1+O# zLE_ZUryXa7+X@XZ;eFnz=h@3Db1!l{tIz9X+46X$WvUxS0>ynQYiequE}{19`q1Wt zhDVB=fMAX$zx1HU5wTL;T6l8bFU~{qPRFEyEq%t?4)}CDBUcbHxtT4z%C$UwTp#)&BSC fn-`L;SNOYcJ9}o2i{h{YLV$vds&uua$=Ck}%a)?h literal 0 HcmV?d00001 diff --git a/l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py b/l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py index 12322a1fc080..7c128e25f465 100644 --- a/l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py +++ b/l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py @@ -3,6 +3,7 @@ from psycopg2 import IntegrityError from odoo.exceptions import UserError +from odoo.modules import get_module_resource from odoo.tests import Form from odoo.tools import mute_logger @@ -103,6 +104,17 @@ def test_01_xml_import(self): self.assertEqual(invoice.ftpa_incoterms, "DAP") self.assertEqual(invoice.fiscal_document_type_id.code, "TD01") self.assertTrue(invoice.art73) + + # verify if attached documents are correctly imported + attachments = invoice.fatturapa_doc_attachments + self.assertEqual(len(attachments), 1) + orig_attachment_path = get_module_resource( + "l10n_it_fatturapa_in", "tests", "data", "test.png" + ) + with open(orig_attachment_path, "rb") as orig_attachment: + orig_attachment_data = orig_attachment.read() + self.assertEqual(attachments[0].raw, orig_attachment_data) + # allow following tests to reuse the same XML file invoice.ref = invoice.payment_reference = "14011"