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.project

Compute Method: _compute_milestone_count

Inputs Method Outputs
  • id
read_group = self.env['project.milestone']._read_group([('project_id', 'in', self.ids)], ['project_id'], ['__count'])
mapped_count = {project.id: count for project, count in read_group}
for project in self:
            project.milestone_count = mapped_count.get(project.id, 0)

Back to entity