diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py index 13171ce1814..71e3045f4d8 100644 --- a/addons/gamification/models/challenge.py +++ b/addons/gamification/models/challenge.py @@ -380,6 +380,9 @@ class gamification_challenge(osv.Model): Create goals that haven't been created yet (eg: if added users) Recompute the current value for each goal related""" + goal_obj = self.pool['gamification.goal'] + goal_ids = goal_obj.search(cr, uid, [('challenge_id', 'in', ids), ('state', '=', 'inprogress')], context=context) + goal_obj.unlink(cr, uid, goal_ids, context=context) return self._update_all(cr, uid, ids=ids, context=context) def action_report_progress(self, cr, uid, ids, context=None):