diff options
| author | Goffin Simon <sig@odoo.com> | 2016-06-09 14:26:41 +0200 |
|---|---|---|
| committer | Goffin Simon <sig@odoo.com> | 2016-06-09 14:26:41 +0200 |
| commit | 89f424dd2819966581894ade2ff6d71d4906ba7e (patch) | |
| tree | c67c054ed1bce1cd2875bc4369bd588000f08350 | |
| parent | 3ed483caa10b526f51bed4b0f999b3567dfb7942 (diff) | |
[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
| -rw-r--r-- | addons/project_timesheet/project_timesheet.py | 4 |
1 files 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): |
