[FIX] hr_timesheet: recomputation depends of the task progress

The task progress value depends on the stage of the task,
if it's a folded stage or not.

If the task was being changed of stage, from
a non-folded stage to a folded stage,
the recomputation of the progress was not done,
while it was needed as a task in a final
stage is considered to be done.

This is a regression during migration to the new api in
e6ac7a7d25
This commit is contained in:
Denis Ledoux
2017-02-21 15:12:44 +01:00
parent 05810dc7de
commit 9e7bc3623a
+1 -1
View File
@@ -20,7 +20,7 @@ class Task(models.Model):
for task in self:
task.subtask_count = self.search_count([('id', 'child_of', task.id), ('id', '!=', task.id)])
@api.depends('timesheet_ids.unit_amount', 'planned_hours', 'child_ids.stage_id',
@api.depends('stage_id', 'timesheet_ids.unit_amount', 'planned_hours', 'child_ids.stage_id',
'child_ids.planned_hours', 'child_ids.effective_hours', 'child_ids.children_hours', 'child_ids.timesheet_ids.unit_amount')
def _hours_get(self):
for task in self.sorted(key='id', reverse=True):