FIX mail_show_follower: ValueError: Expected singleton: res.users

This commit is contained in:
eLBati 2021-10-15 16:35:52 +02:00 committed by Eduardo De Miguel
parent c7a1b4f501
commit e7eeb2c5b6

View File

@ -32,7 +32,8 @@ class MailMail(models.Model):
).mapped('partner_id').ids ).mapped('partner_id').ids
partners_len = len(partners_obj.filtered( partners_len = len(partners_obj.filtered(
lambda x: x.id not in user_partner_ids and ( lambda x: x.id not in user_partner_ids and (
not x.user_ids or group_portal in x.user_ids.groups_id not x.user_ids or
group_portal in x.user_ids.mapped("groups_id")
))) )))
if partners_len > 1: if partners_len > 1:
# get partners # get partners
@ -54,7 +55,7 @@ class MailMail(models.Model):
partners = partners_obj.filtered( partners = partners_obj.filtered(
lambda x: x.id not in user_partner_ids and ( lambda x: x.id not in user_partner_ids and (
not x.user_ids or group_portal in not x.user_ids or group_portal in
x.user_ids.groups_id x.user_ids.mapped("groups_id")
) )
) )
partners = partners.filtered( partners = partners.filtered(