From f0741b3f3eb9236acfcd76a11c1bf5bb2ea107d5 Mon Sep 17 00:00:00 2001 From: David Beguin Date: Mon, 17 Dec 2018 09:24:58 +0000 Subject: [PATCH] [FIX] im_livechat : fix random operator and channel name mismatch Before, the name of the channel was not always matching the real channel operator, as a second random was made on operators. This commit fix this. Task ID : 1918350 Closes PR #29570 --- addons/im_livechat/models/im_livechat_channel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/im_livechat/models/im_livechat_channel.py b/addons/im_livechat/models/im_livechat_channel.py index a5c187a1067..18a112d526a 100644 --- a/addons/im_livechat/models/im_livechat_channel.py +++ b/addons/im_livechat/models/im_livechat_channel.py @@ -149,7 +149,7 @@ class ImLivechatChannel(models.Model): return False # choose the res.users operator and get its partner id operator = random.choice(operators) - operator_partner_id = random.choice(operators).partner_id.id + operator_partner_id = operator.partner_id.id # partner to add to the mail.channel channel_partner_to_add = [(4, operator_partner_id)] if self.env.user and self.env.user.active: # valid session user (not public)