[IMP] mail_debrand: Split code into model-specific files
This commit is contained in:
parent
42c4779078
commit
aa00a02097
@ -1 +1,2 @@
|
|||||||
from . import mail_render_mixinANDmail_mail
|
from . import mail_render_mixin
|
||||||
|
from . import mail_mail
|
||||||
|
24
mail_debrand/models/mail_mail.py
Normal file
24
mail_debrand/models/mail_mail.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Copyright 2019 O4SB - Graeme Gellatly
|
||||||
|
# Copyright 2019 Tecnativa - Ernesto Tejeda
|
||||||
|
# Copyright 2020 Onestein - Andrea Stirpe
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
from odoo import api, models
|
||||||
|
|
||||||
|
|
||||||
|
class MailMail(models.AbstractModel):
|
||||||
|
_inherit = "mail.mail"
|
||||||
|
|
||||||
|
# in messages from objects is adding using Odoo that we are going to remove
|
||||||
|
|
||||||
|
@api.model_create_multi
|
||||||
|
def create(self, values_list):
|
||||||
|
for index, _value in enumerate(values_list):
|
||||||
|
values_list[index]["body_html"] = self.env[
|
||||||
|
"mail.render.mixin"
|
||||||
|
].remove_href_odoo(
|
||||||
|
values_list[index].get("body_html", ""),
|
||||||
|
remove_parent=0,
|
||||||
|
remove_before=1,
|
||||||
|
)
|
||||||
|
|
||||||
|
return super().create(values_list)
|
@ -88,22 +88,3 @@ class MailRenderMixin(models.AbstractModel):
|
|||||||
orginal_rendered[key] = self.remove_href_odoo(orginal_rendered[key])
|
orginal_rendered[key] = self.remove_href_odoo(orginal_rendered[key])
|
||||||
|
|
||||||
return orginal_rendered
|
return orginal_rendered
|
||||||
|
|
||||||
|
|
||||||
class MailMail(models.AbstractModel):
|
|
||||||
_inherit = "mail.mail"
|
|
||||||
|
|
||||||
# in messages from objects is adding using Odoo that we are going to remove
|
|
||||||
|
|
||||||
@api.model_create_multi
|
|
||||||
def create(self, values_list):
|
|
||||||
for index, _value in enumerate(values_list):
|
|
||||||
values_list[index]["body_html"] = self.env[
|
|
||||||
"mail.render.mixin"
|
|
||||||
].remove_href_odoo(
|
|
||||||
values_list[index].get("body_html", ""),
|
|
||||||
remove_parent=0,
|
|
||||||
remove_before=1,
|
|
||||||
)
|
|
||||||
|
|
||||||
return super().create(values_list)
|
|
Loading…
Reference in New Issue
Block a user