'Returns a dictionary with key=the ID of a record and value = the level of this
record in the tree structure.'

@api.multi
@api.depends('parent_id', 'parent_id.level')
def _get_level(self):

    for report in self:
        level = 0
        if report.parent_id:
            level = (report.parent_id.level + 1)
        report.level = level
