From 131d01ecaa0beb10170485c01cbdf660d0e437b1 Mon Sep 17 00:00:00 2001 From: fw-bot Date: Fri, 5 Mar 2021 14:24:09 +0000 Subject: [PATCH] [FIX] l10n_it_edi: send only 'out_invoice' to SDI PEC server For each move post the system send a PEC. This should not occur, as only outgoing invoice should be registered in the EDI system as e-invoice opw-2461496 closes odoo/odoo#67406 X-original-commit: 2bbe214e816902d7e0c85ca38fedbeece9c47e7d Signed-off-by: Josse Colpaert Signed-off-by: agr-odoo --- 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 e1198a4919c..549bce2c4d2 100644 --- a/addons/l10n_it_edi/models/account_invoice.py +++ b/addons/l10n_it_edi/models/account_invoice.py @@ -248,7 +248,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'): + for move in posted.filtered(lambda m: m.l10n_it_send_state == 'to_send' and m.move_type == 'out_invoice'): move.send_pec_mail() return posted