[FIX] l10n_it_edi: do not use inactive mail server

Do not use an inactive mail server to send the requests.

opw-2197011

closes odoo/odoo#45375

X-original-commit: ecc4759c03534ccb37ebf9eea202abdf387adca9
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2020-02-14 10:00:59 +00:00
parent 90bd53a204
commit 9d0c32d326
+5 -1
View File
@@ -258,7 +258,11 @@ class AccountMove(models.Model):
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."))
)