From fb2c1e8b2631d486de82fce84f6214c0e10823b7 Mon Sep 17 00:00:00 2001 From: "Paolo Gatti (pgi)" Date: Sat, 18 Feb 2023 16:04:58 +0000 Subject: [PATCH] [IMP] l10n_it_edi_sdicoop: Cannot delete already sent attached files If an invoice is send to the Tax Agency, we should block the fact that the user can delete it. In that case, we can have issues when the tax agency sends back notifications. Task link: https://www.odoo.com/web#id=3192962&model=project.task Task-3192962 closes odoo/odoo#114872 X-original-commit: c11a512af4e467068c6b228bf55225e5e43d7811 Signed-off-by: Josse Colpaert Signed-off-by: Paolo Gatti (pgi) --- 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 38147100b16..6b5d122f6b0 100644 --- a/addons/l10n_it_edi/models/account_invoice.py +++ b/addons/l10n_it_edi/models/account_invoice.py @@ -21,7 +21,7 @@ class AccountMove(models.Model): _inherit = 'account.move' l10n_it_edi_transaction = fields.Char(copy=False, string="FatturaPA Transaction") - l10n_it_edi_attachment_id = fields.Many2one('ir.attachment', copy=False, string="FatturaPA Attachment") + l10n_it_edi_attachment_id = fields.Many2one('ir.attachment', copy=False, string="FatturaPA Attachment", ondelete="restrict") l10n_it_stamp_duty = fields.Float(default=0, string="Dati Bollo", readonly=True, states={'draft': [('readonly', False)]})