From 9d0c32d326306d7c898f2b5c86c64670103bdb0d Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 13 Feb 2020 16:31:45 +0000 Subject: [PATCH] [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) --- addons/l10n_it_edi/models/account_invoice.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/l10n_it_edi/models/account_invoice.py b/addons/l10n_it_edi/models/account_invoice.py index c097d3f4337..54c0a8177c2 100644 --- a/addons/l10n_it_edi/models/account_invoice.py +++ b/addons/l10n_it_edi/models/account_invoice.py @@ -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.")) )