mirror of
https://github.com/bringout/oca-ocb-mail.git
synced 2026-04-20 02:42:08 +02:00
Initial commit: Mail packages
This commit is contained in:
commit
4e53507711
1948 changed files with 751201 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class MailRenderMixin(models.AbstractModel):
|
||||
_inherit = "mail.render.mixin"
|
||||
|
||||
@api.model
|
||||
def _render_template_postprocess(self, rendered):
|
||||
# super will transform relative url to absolute
|
||||
rendered = super(MailRenderMixin, self)._render_template_postprocess(rendered)
|
||||
|
||||
# apply shortener after
|
||||
if self.env.context.get('post_convert_links'):
|
||||
for res_id, html in rendered.items():
|
||||
rendered[res_id] = self._shorten_links(
|
||||
html,
|
||||
self.env.context['post_convert_links'],
|
||||
blacklist=['/unsubscribe_from_list', '/view']
|
||||
)
|
||||
return rendered
|
||||
Loading…
Add table
Add a link
Reference in a new issue