diff --git a/addons/l10n_it_edi/models/account_invoice.py b/addons/l10n_it_edi/models/account_invoice.py index 54c0a8177c2..387e6655289 100644 --- a/addons/l10n_it_edi/models/account_invoice.py +++ b/addons/l10n_it_edi/models/account_invoice.py @@ -52,7 +52,10 @@ class AccountMove(models.Model): super(AccountMove, self).post() # Retrieve invoices to generate the xml. - invoices_to_export = self.filtered(lambda move: move.company_id.country_id == self.env.ref('base.it') and move.is_sale_document()) + invoices_to_export = self.filtered(lambda move: + move.company_id.country_id == self.env.ref('base.it') and + move.is_sale_document() and + move.l10n_it_send_state not in ['sent', 'delivered', 'delivered_accepted']) invoices_to_export.write({'l10n_it_send_state': 'other'}) invoices_to_send = self.env['account.move']