Skip to content

Commit

Permalink
TA#72205 [16.0][MIG][REM] project_time_range : depends on compute (#505)
Browse files Browse the repository at this point in the history
  • Loading branch information
lanto-razafindrabe authored Jan 28, 2025
1 parent ef18f24 commit efa79a2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions project_time_range/models/project_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).


from odoo import fields, models, api, _
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError

from .util import time_range_constraint


Expand All @@ -22,12 +23,10 @@ class ProjectTask(models.Model):
"Sub-tasks Max", compute="_compute_subtask_max_hours"
)

@api.depends("child_ids.min_hours")
def _compute_subtask_min_hours(self):
for task in self:
task.subtask_min_hours = sum(task.child_ids.mapped("min_hours"))

@api.depends("child_ids.max_hours")
def _compute_subtask_max_hours(self):
for task in self:
task.subtask_max_hours = sum(task.child_ids.mapped("max_hours"))
Expand Down

0 comments on commit efa79a2

Please sign in to comment.