Files
odoo_source/addons/digest/models/digest_tip.py
T
Mitul Shah ab0d415263 [IMP] digest: fix tip description
Before this Commit, while sending the digest emails, the tip description was
incorrect due to sanitizing. Some jinja was also badly converted into
inline qweb instead of regular qweb.

After this Commit, we have fixed the tip description field value. We do the
html_sanitize after rendering the QWEB template. So, we get the proper values
of conditions and aliases. Replacing jinja with qweb template, should use
<t t-out="variable"/> to print the dynamic value so, remove the inline_template
expression `{{` and `}}` and put the <t t-out="variable"/>.

Task-2704083

closes odoo/odoo#88937

X-original-commit: c08cdc39965df1941b12a98dc80a015673f502e0
Related: odoo/enterprise#26293
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-04-15 21:01:56 +02:00

23 lines
847 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
from odoo.tools.translate import html_translate
class DigestTip(models.Model):
_name = 'digest.tip'
_description = 'Digest Tips'
_order = 'sequence'
sequence = fields.Integer(
'Sequence', default=1,
help='Used to display digest tip in email template base on order')
name = fields.Char('Name', translate=True)
user_ids = fields.Many2many(
'res.users', string='Recipients',
help='Users having already received this tip')
tip_description = fields.Html('Tip description', translate=html_translate, sanitize=False)
group_id = fields.Many2one(
'res.groups', string='Authorized Group',
default=lambda self: self.env.ref('base.group_user'))