im_livechat.py 864 B

123456789101112131415161718192021222324
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from odoo import api, models, fields
  4. from odoo.addons.http_routing.models.ir_http import slug
  5. from odoo.tools.translate import html_translate
  6. class ImLivechatChannel(models.Model):
  7. _name = 'im_livechat.channel'
  8. _inherit = ['im_livechat.channel', 'website.published.mixin']
  9. def _compute_website_url(self):
  10. super(ImLivechatChannel, self)._compute_website_url()
  11. for channel in self:
  12. channel.website_url = "/livechat/channel/%s" % (slug(channel),)
  13. website_description = fields.Html(
  14. "Website description", default=False, translate=html_translate,
  15. sanitize_overridable=True,
  16. sanitize_attributes=False, sanitize_form=False,
  17. help="Description of the channel displayed on the website page")