Skip to content

Commit b27c378

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

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
@@ -231,4 +231,11 @@ def create_fatturapa_attachment_in(self, attachment, message_dict=None):
231231
dict(), # Not managing metadata files for now
232232
**default_values,
233233
)
234+
235+
# Notify if there was an error
236+
# during automatic import of invoices from PEC.
237+
for attachment in attachments:
238+
parsing_error = attachment.e_invoice_parsing_error
239+
if parsing_error:
240+
raise Exception(parsing_error)
234241
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
@@ -139,7 +139,10 @@ def test_process_response_INVIO_broken_XML(self):
139139
instance.stat.return_value = (1, 1)
140140
instance.retr.return_value = ("", [incoming_mail], "")
141141

142-
with mute_logger("odoo.addons.l10n_it_fatturapa_pec.models.fetchmail"):
142+
with mute_logger(
143+
"odoo.addons.l10n_it_fatturapa_in.models.attachment",
144+
"odoo.addons.l10n_it_fatturapa_pec.models.fetchmail",
145+
):
143146
self.PEC_server.fetch_mail()
144147

145148
error_mails = outbound_mail_model.search(error_mail_domain)

0 commit comments

Comments
 (0)