[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
This commit is contained in:
David Beguin
2018-12-17 09:54:08 +00:00
parent 1fa10cbc5d
commit f0741b3f3e
@@ -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)