'Returns a dict with 3 keys {todo, done, total}.
These keys all map to integers and provide the number of todos
marked as open, the total number of todos and the number of
todos not open (which is basically a shortcut to total-todo)
:rtype: dict'

@api.multi
def progress(self):

    user_groups = self.env.user.groups_id
    def groups_match(todo):
        "    Checks    if    the    todo's    groups    match    those    of    the    current    user    "
        return ((not todo.groups_id) or bool((todo.groups_id & user_groups)))
    done = filter(groups_match, self.browse(self.search([('state', '!=', 'open')])))
    total = filter(groups_match, self.browse(self.search([])))
    return {'done': len(done), 'total': len(total), 'todo': (len(total) - len(done))}
