Files
odoo_source/addons/website_livechat/models/im_livechat.py
T
qsm-odoo c21568e14f [FIX] *: html fields sanitization
Since commit c9e38cae9f in saas-10, the html fields are sanitized in
strict mode by default. This breaks all html fields behaviour when it
is editable in the website editor.

This commit deactivate the sanitization for such HTML fields (like it
was already the case for blogs contents or products descriptions for
example). A more specific sanitization will be implemented in future
versions.
2016-07-11 16:02:20 +02:00

20 lines
822 B
Python

# -*- coding: utf-8 -*-
from openerp import api, models, fields
from openerp.addons.website.models.website import slug
class ImLivechatChannel(models.Model):
_name = 'im_livechat.channel'
_inherit = ['im_livechat.channel', 'website.published.mixin']
@api.v7
# TODO : when mixin in new api.v8, change this !
def _website_url(self, cr, uid, ids, field_name, arg, context=None):
res = super(ImLivechatChannel, self)._website_url(cr, uid, ids, field_name, arg, context=context)
for channel in self.browse(cr, uid, ids, context=context):
res[channel.id] = "/livechat/channel/%s" % (slug(channel),)
return res
website_description = fields.Html("Website description", default=False, help="Description of the channel displayed on the website page", sanitize=False)