From 96be5b404a75f5455ca6b84302decb157ac8e1ef Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 27 Aug 2015 09:39:44 +0200 Subject: [PATCH] [FIX] gamification: Refresh Challenge When clicking on the button "Refresh Challenge" in the "gamification.challenge" view form, all the "gamification.goal" records linked to this challenge must be updated. opw:647983 --- addons/gamification/models/challenge.py | 3 +++ 1 file changed, 3 insertions(+) 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):