diff --git a/addons/mail/models/mail_channel.py b/addons/mail/models/mail_channel.py index 3986b4d8da6..a0200762e81 100644 --- a/addons/mail/models/mail_channel.py +++ b/addons/mail/models/mail_channel.py @@ -99,7 +99,7 @@ class Channel(models.Model): @api.constrains('channel_last_seen_partner_ids', 'channel_partner_ids') def _constraint_partners_chat(self): - for ch in self.filtered(lambda ch: ch.channel_type == 'chat'): + for ch in self.sudo().filtered(lambda ch: ch.channel_type == 'chat'): if len(ch.channel_last_seen_partner_ids) > 2 or len(ch.channel_partner_ids) > 2: raise ValidationError(_("A channel of type 'chat' cannot have more than two users."))