Skip to content

Commit 7e415a1

Browse files
SirTakobieLBati
authored andcommitted
[14.0] l10n_it_fatturapa_pec: forward port of OCA#2788
Other changes included in OCA#3118
1 parent d5a1285 commit 7e415a1

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

l10n_it_fatturapa_pec/models/mail_thread.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,4 +233,11 @@ def create_fatturapa_attachment_in(self, attachment, message_dict=None):
233233
dict(), # Not managing metadata files for now
234234
**default_values,
235235
)
236+
237+
# Notify if there was an error
238+
# during automatic import of invoices from PEC.
239+
for attachment in attachments:
240+
parsing_error = attachment.e_invoice_parsing_error
241+
if parsing_error:
242+
raise Exception(parsing_error)
236243
return attachments

l10n_it_fatturapa_pec/tests/test_e_invoice_response.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ def test_process_response_INVIO_broken_XML(self):
137137
instance.stat.return_value = (1, 1)
138138
instance.retr.return_value = ("", [incoming_mail], "")
139139

140-
with mute_logger("odoo.addons.l10n_it_fatturapa_pec.models.fetchmail"):
140+
with mute_logger(
141+
"odoo.addons.l10n_it_fatturapa_in.models.attachment",
142+
"odoo.addons.l10n_it_fatturapa_pec.models.fetchmail",
143+
):
141144
self.PEC_server.fetch_mail()
142145

143146
error_mails = outbound_mail_model.search(error_mail_domain)

0 commit comments

Comments
 (0)