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

Module: Project

Entity: project.task

Compute Method: _compute_display_follow_button

View 20.0
Inputs Method Outputs
  • project_id
  • project_id.ids
+ if not self.env.user.share:
+             self.display_follow_button = False
+             return
+ collaborator_projects = self.env['project.collaborator'].sudo().search([
+             ('project_id', 'in', self.project_id.ids),
+             ('partner_id', '=', self.env.user.partner_id.id)
+         ])
+ collaborator_project_ids = collaborator_projects.mapped('project_id')
+ for task in self:
+             task.display_follow_button = task.project_id in collaborator_project_ids
  • display_follow_button

Back to entity