oca-ocb-mail/odoo-bringout-oca-ocb-im_livechat/im_livechat/models/ir_websocket.py
Ernad Husremovic daa394e8b0 19.0 vanilla
2026-03-09 09:31:39 +01:00

21 lines
783 B
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class IrWebsocket(models.AbstractModel):
_inherit = "ir.websocket"
def _build_bus_channel_list(self, channels):
channels = list(channels) # do not alter original list
if any(
channel == "im_livechat.looking_for_help"
for channel in channels
if isinstance(channel, str)
):
if self.env.user.has_group("im_livechat.im_livechat_group_user"):
channels.append(
(self.env.ref("im_livechat.im_livechat_group_user"), "LOOKING_FOR_HELP")
)
channels.remove("im_livechat.looking_for_help")
return super()._build_bus_channel_list(channels)