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

Module: Project Milestone Status

Entity: project.milestone

Compute Method: _compute_dedication

Inputs Method Outputs
  • task_ids
for milestone in self:
            total_allocated_hours = sum(milestone.task_ids.mapped("allocated_hours"))
            total_dedicated_hours = sum(milestone.task_ids.mapped("effective_hours"))

            if total_dedicated_hours and total_allocated_hours:
                milestone.dedication = (
                    total_dedicated_hours * 100 / total_allocated_hours
                )
            else:
                milestone.dedication = 0

Back to entity