From 82e4c1994728dc70caf6f5c94e461ba699178d51 Mon Sep 17 00:00:00 2001 From: "Andrea Grazioso (agr-odoo)" Date: Fri, 9 Apr 2021 10:12:31 +0000 Subject: [PATCH] [FIX] l10n_it_edi: only send e-invoice in IT companies Have 2 companies, one in FR (with l10n_fr), one in IT (with l10n_it_edi) From the French company create an invoice for a french customer. Confirm. The message ' E-Invoice check failed. You can modify the invoice, and resend it.' related to italian e-invoicing will appear opw-2481035 closes odoo/odoo#69050 X-original-commit: d5075308131f82020702c6650a1869ffd93fb85e Signed-off-by: Josse Colpaert --- addons/l10n_it_edi/models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_it_edi/models/account_invoice.py b/addons/l10n_it_edi/models/account_invoice.py index 2103f8eb7d6..8abd7fe981b 100644 --- a/addons/l10n_it_edi/models/account_invoice.py +++ b/addons/l10n_it_edi/models/account_invoice.py @@ -260,7 +260,7 @@ class AccountMove(models.Model): # OVERRIDE posted = super()._post(soft=soft) - for move in posted.filtered(lambda m: m.l10n_it_send_state == 'to_send' and m.move_type == 'out_invoice'): + for move in posted.filtered(lambda m: m.l10n_it_send_state == 'to_send' and m.move_type == 'out_invoice' and m.company_id.country_id.code == 'IT'): move.send_pec_mail() return posted