From 89f424dd2819966581894ade2ff6d71d4906ba7e Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 9 Jun 2016 14:26:41 +0200 Subject: [PATCH] [FIX] project_timesheet: _get_subtask_count The task itself doesn't have to be counted, but substrcting one to the total count was wrong when the task itself was archived. opw:680207 --- addons/project_timesheet/project_timesheet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index 3dbc9f1c8cd..f45243771c2 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -100,8 +100,8 @@ class task(osv.osv): def _get_subtask_count(self, cr, uid, ids, field_names, args, context=None): res = dict.fromkeys(ids, 0) for task_id in ids: - res[task_id] = (self.search_count( - cr, uid, [('id', 'child_of', task_id)], context=context) - 1) # don't count task itself + res[task_id] = (len(set(self.search( + cr, uid, [('id', 'child_of', task_id)], context=context)) - {task_id})) # don't count task itself return res def _get_task(self, cr, uid, ids, context=None):