Skip to content

Commit

Permalink
[FIX] l10n_it_edi: do not use inactive mail server
Browse files Browse the repository at this point in the history
Do not use an inactive mail server to send the requests.

opw-2197011

closes #45335

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
  • Loading branch information
nim-odoo committed Feb 13, 2020
1 parent 5419528 commit ecc4759
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion addons/l10n_it_edi/models/account_invoice.py
Expand Up @@ -259,7 +259,11 @@ def send_pec_mail(self):
self.ensure_one()
allowed_state = ['to_send', 'invalid']

if not self.company_id.l10n_it_mail_pec_server_id or not self.company_id.l10n_it_address_send_fatturapa:
if (
not self.company_id.l10n_it_mail_pec_server_id
or not self.company_id.l10n_it_mail_pec_server_id.active
or not self.company_id.l10n_it_address_send_fatturapa
):
self.message_post(
body=(_("Error when sending mail with E-Invoice: Your company must have a mail PEC server and must indicate the mail PEC that will send electronic invoice."))
)
Expand Down

0 comments on commit ecc4759

Please sign in to comment.