Files
odoo_source/addons/website_livechat/models/website.py
T
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00

21 lines
608 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class Website(models.Model):
_inherit = "website"
channel_id = fields.Many2one('im_livechat.channel', string='Website Live Chat Channel')
def get_livechat_channel_info(self):
""" Get the livechat info dict (button text, channel name, ...) for the livechat channel of
the current website.
"""
self.ensure_one()
if self.channel_id:
return self.channel_id.sudo().get_livechat_info()
return {}