You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
608 B
23 lines
608 B
# coding: utf-8
|
|
# © 2017 David BEAL @ Akretion
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
|
|
import logging
|
|
from odoo import models
|
|
|
|
_logger = logging.getLogger(__name__)
|
|
|
|
try:
|
|
from premailer import transform
|
|
except (ImportError, IOError) as err:
|
|
_logger.debug(err)
|
|
|
|
|
|
class MailTemplate(models.Model):
|
|
_inherit = 'mail.template'
|
|
|
|
def generate_email(self, res_ids, fields=None):
|
|
res = super(MailTemplate, self).generate_email(res_ids, fields=fields)
|
|
if 'body_html' in res:
|
|
res['body_html'] = transform(res['body_html'])
|
|
return res
|