Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Discuss

Entity: mail.thread

Compute Method: _compute_message_is_follower

Inputs Method Outputs
  • id
followers = self.env['mail.followers'].sudo().search_fetch(
            [('res_model', '=', self._name), ('res_id', 'in', self.ids), ('partner_id', '=', self.env.user.partner_id.id)],
            ['res_id'],
        )
following_ids = set(followers.mapped('res_id'))
for record in self:
            record.message_is_follower = record.id in following_ids

Back to entity