domain = [‘|’, ‘|’, (‘channel_id.public’, ‘=’, ‘public’), ‘&’, (‘channel_id.public’, ‘=’, ‘private’), (‘channel_id.channel_partner_ids’, ‘in’, [user.partner_id.id]), ‘&’, (‘channel_id.public’, ‘=’, ‘groups’), (‘channel_id.group_public_id’, ‘in’, [g.id for g in user.groups_id])]
domain1 = AND([ (‘channel_id.public’, ‘=’, ‘groups’), (‘channel_id.group_public_id’, ‘in’, [g.id for g in user.groups_id])]) domain2 = AND([ (‘channel_id.public’, ‘=’, ‘private’), (‘channel_id.channel_partner_ids’, ‘in’, [user.partner_id.id]) ]) domain3 = OR([ (‘channel_id.public’, ‘=’, ‘public’), domain2] domain4= OR([ domain1, domain3])