Skip to content

Commit

Permalink
[14.0] l10n_it_fatturapa_pec: forward port of OCA#2788
Browse files Browse the repository at this point in the history
Other changes included in OCA#3118
  • Loading branch information
SirTakobi authored and eLBati committed Jan 20, 2024
1 parent 85f5f95 commit daf7f88
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions l10n_it_fatturapa_pec/models/mail_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,11 @@ def create_fatturapa_attachment_in(self, attachment, message_dict=None):
dict(), # Not managing metadata files for now
**default_values,
)

# Notify if there was an error
# during automatic import of invoices from PEC.
for attachment in attachments:
parsing_error = attachment.e_invoice_parsing_error
if parsing_error:
raise Exception(parsing_error)
return attachments
5 changes: 4 additions & 1 deletion l10n_it_fatturapa_pec/tests/test_e_invoice_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ def test_process_response_INVIO_broken_XML(self):
instance.stat.return_value = (1, 1)
instance.retr.return_value = ("", [incoming_mail], "")

with mute_logger("odoo.addons.l10n_it_fatturapa_pec.models.fetchmail"):
with mute_logger(
"odoo.addons.l10n_it_fatturapa_in.models.attachment",
"odoo.addons.l10n_it_fatturapa_pec.models.fetchmail",
):
self.PEC_server.fetch_mail()

error_mails = outbound_mail_model.search(error_mail_domain)
Expand Down

0 comments on commit daf7f88

Please sign in to comment.