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_has_late_and_unreached_milestone

Inputs Method Outputs
if all(not task.allow_milestones for task in self):
            self.has_late_and_unreached_milestone = False
            return
late_milestones = self.env['project.milestone'].sudo()._search([  # sudo is needed for the portal user in Project Sharing.
            ('id', 'in', self.milestone_id.ids),
            ('is_reached', '=', False),
            ('deadline', '<=', 'today'),
        ])
for task in self:
            task.has_late_and_unreached_milestone = task.allow_milestones and task.milestone_id.id in late_milestones

Back to entity