'Return the percentage of completeness of the goal, between 0 and 100'

@api.depends('current', 'target_goal', 'definition_id.condition')
def _get_completion(self):

    for goal in self:
        if (goal.definition_condition == 'higher'):
            if (goal.current >= goal.target_goal):
                goal.completeness = 100.0
            else:
                goal.completeness = round(((100.0 * goal.current) / goal.target_goal), 2)
        elif (goal.current < goal.target_goal):
            goal.completeness = 100.0
        else:
            goal.completeness = 0.0
