From 1777646d1ecd1325d4bfc5bdac5598efda8003f5 Mon Sep 17 00:00:00 2001 From: len-odoo Date: Tue, 17 Apr 2018 11:03:09 +0200 Subject: [PATCH] [FIX]mail: fix help command in livechat with unlogged user When an unlogged user creates a livechat, typing the /help command in the backend would result in the help command sending a traceback. The function processing the command would assume the existence of a channel partner name, which is not the case when the user starting the chat is unlogged. opw:1835484 --- addons/mail/models/mail_channel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/models/mail_channel.py b/addons/mail/models/mail_channel.py index fb33fbf1323..8be0884b346 100644 --- a/addons/mail/models/mail_channel.py +++ b/addons/mail/models/mail_channel.py @@ -648,7 +648,7 @@ class Channel(models.Model): msg += _(" This channel is private. People must be invited to join it.") else: channel_partners = self.env['mail.channel.partner'].search([('partner_id', '!=', partner.id), ('channel_id', '=', self.id)]) - msg = _("You are in a private conversation with @%s.") % channel_partners[0].partner_id.name + msg = _("You are in a private conversation with @%s.") % (channel_partners[0].partner_id.name if channel_partners else _('Anonymous')) msg += _("""

You can mention someone by typing @username, this will grab its attention.
You can mention a channel by typing #channel.