[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
This commit is contained in:
Goffin Simon
2016-06-09 14:26:41 +02:00
parent 3ed483caa1
commit 89f424dd28
@@ -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):