Reputation: 61
Can somebody give me example (or hint) how to select all records where user is follower? I cant find any information about handling followers. What the condition should be?
find_record = self.env['my_class'].search([( **user is floower** )])
Upvotes: 1
Views: 512
Reputation: 1
try the following
first element of the tuple : the partner id related to the user
2nd element of the tuple : the logical operator 'in'
3rd element of the tuple : the id of partners following the record
self.env['helpdesk.ticket'].search([(self.env.user.partner_id.id, 'in', 'message_follower_ids.partner_id')])
Upvotes: 0
Reputation: 26738
Followers are related to partners, you can select records where current user related partner is in followers:
self.env['sale.order'].search([('message_follower_ids.partner_id', '=', self.env.user.partner_id.id)])
Upvotes: 2