19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:30:07 +01:00
parent ba20ce7443
commit 768b70e05e
2357 changed files with 1057103 additions and 712486 deletions

View file

@ -0,0 +1,16 @@
from odoo import _, api, models
from odoo.exceptions import UserError
class MailTemplate(models.Model):
_inherit = 'mail.template'
@api.ondelete(at_uninstall=False)
def _unlink_except_master_mail_template(self):
master_xmlids = {
"account.email_template_edi_invoice",
"account.email_template_edi_credit_note",
}
removed_xml_ids = set(self.get_external_id().values())
if removed_xml_ids.intersection(master_xmlids):
raise UserError(_("You cannot delete this mail template, it is used in the invoice sending flow."))