diff --git a/addons/gamification/models/goal.py b/addons/gamification/models/goal.py index 925b05de5ab..2408e58d3d7 100644 --- a/addons/gamification/models/goal.py +++ b/addons/gamification/models/goal.py @@ -249,16 +249,15 @@ class gamification_goal(osv.Model): 'object': goal, 'pool': self.pool, 'cr': cr, - 'context': dict(context), # copy context to prevent side-effects of eval + 'context': dict(context), # copy context to prevent side-effects of eval 'uid': uid, - 'result': False, 'date': date, 'datetime': datetime, 'timedelta': timedelta, 'time': time } code = goal.definition_id.compute_code.strip() safe_eval(code, cxt, mode="exec", nocopy=True) # the result of the evaluated codeis put in the 'result' local variable, propagated to the context - result = cxt.get('result', False) - if result and type(result) in (float, int, long): + result = cxt.get('result') + if result is not None and type(result) in (float, int, long): if result != goal.current: towrite['current'] = result else: