From d32ba1a55ee48897bb5629f7a0c644a729b0cb0a Mon Sep 17 00:00:00 2001 From: Zelong Lin Date: Mon, 26 Jun 2023 11:28:17 +0000 Subject: [PATCH] [FIX] mail: add users from self-chat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, when opening self-chat and trying to add users, self id was duplicated with the chat partner id, leading to a crash. This commit fixes the issue by removing duplicates in inviting users, so that there's no longer a crash when inviting users in self-chat. task-3381895 closes odoo/odoo#126605 X-original-commit: d101a82b97989d5c60c1b6dfbc5fa2143680bd3c Signed-off-by: Alexandre Kühn (aku) --- addons/mail/models/discuss/discuss_channel.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/mail/models/discuss/discuss_channel.py b/addons/mail/models/discuss/discuss_channel.py index 23854c26aab..bf6dbe7771c 100644 --- a/addons/mail/models/discuss/discuss_channel.py +++ b/addons/mail/models/discuss/discuss_channel.py @@ -1109,6 +1109,7 @@ class Channel(models.Model): :returns: channel_info of the created channel :rtype: dict """ + partners_to = set(partners_to) channel = self.create({ 'channel_member_ids': [Command.create({'partner_id': partner_id}) for partner_id in partners_to], 'channel_type': 'group',