fix whatsapp

This commit is contained in:
Pranay 2025-03-24 12:54:38 +05:30 committed by administrator
parent bd4cfee509
commit 3f8aa89705
1 changed files with 2 additions and 1 deletions

View File

@ -201,7 +201,8 @@ class DiscussChannel(models.Model):
subtype_xmlid='mail.mt_note', subtype_xmlid='mail.mt_note',
) )
if partners_to_notify == channel.whatsapp_partner_id and wa_account_id.notify_user_ids.partner_id: if partners_to_notify == channel.whatsapp_partner_id and wa_account_id.notify_user_ids.partner_id:
partners_to_notify |= wa_account_id.notify_user_ids.partner_id partners_to_notify += wa_account_id.notify_user_ids.partner_id
partners_to_notify = self.env['res.partner'].browse(list(set(partners_to_notify.ids)))
channel.channel_member_ids = [Command.clear()] + [Command.create({'partner_id': partner.id}) for partner in partners_to_notify] channel.channel_member_ids = [Command.clear()] + [Command.create({'partner_id': partner.id}) for partner in partners_to_notify]
channel._broadcast(partners_to_notify.ids) channel._broadcast(partners_to_notify.ids)
return channel return channel