diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py index 381b78f6693..ae51158290c 100644 --- a/addons/gamification/models/challenge.py +++ b/addons/gamification/models/challenge.py @@ -743,7 +743,7 @@ class Challenge(models.Model): all_reached = False if goal.definition_condition == 'higher': # can be over 100 - total_completeness += 100.0 * goal.current / goal.target_goal + total_completeness += (100.0 * goal.current / goal.target_goal) if goal.target_goal else 0 elif goal.state == 'reached': # for lower goals, can not get percentage so 0 or 100 total_completeness += 100 diff --git a/addons/gamification/models/goal.py b/addons/gamification/models/goal.py index e182769a2e3..ce775ab2bd4 100644 --- a/addons/gamification/models/goal.py +++ b/addons/gamification/models/goal.py @@ -195,7 +195,7 @@ class Goal(models.Model): if goal.current >= goal.target_goal: goal.completeness = 100.0 else: - goal.completeness = round(100.0 * goal.current / goal.target_goal, 2) + goal.completeness = round(100.0 * goal.current / goal.target_goal, 2) if goal.target_goal else 0 elif goal.current < goal.target_goal: # a goal 'lower than' has only two values possible: 0 or 100% goal.completeness = 100.0