summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorAndrea Grazioso (agr-odoo) <agr@odoo.com>2020-02-17 14:17:28 +0000
committerAndrea Grazioso (agr-odoo) <agr@odoo.com>2020-02-18 08:16:57 +0000
commita3f102db491e2cdcbb0c62ae5abf0afd2674a1d0 (patch)
tree9a2ec6db34ccc3a8b931a78e97122682a8da20fe /addons
parent2ee19575be26eb9911a29582c5a09b89a15801fa (diff)
[FIX] l10n_it_edi: allow invoice edit after edi sent
Create an invoice, validate it, sending the data to the SDI. Now reset to draft the invoice and re-validate it. Action will be blocked because "You can't regenerate an E-Invoice when the first one is sent and there are no errors". This add the possibility to modify the invoice without re-sending it as long as the first one is still in a sent-with-no-answer state opw-2196956 closes odoo/odoo#45580 X-original-commit: a315d7dde7ab4c1283c999c336284aeac86dbbbc Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/l10n_it_edi/models/account_invoice.py5
1 files changed, 4 insertions, 1 deletions
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']