From ce5ba45d45062f444b772deaa3828c7366f6c2fe Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 14 May 2014 15:41:38 +0200 Subject: [PATCH] [IMP] gamification: avoid fetching function field while we could reuse the cache system of the browse records (avoid memory errors when updating a large number of records) --- addons/gamification/models/goal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/gamification/models/goal.py b/addons/gamification/models/goal.py index b4a47a0d07a..904e6fafa36 100644 --- a/addons/gamification/models/goal.py +++ b/addons/gamification/models/goal.py @@ -349,8 +349,8 @@ class gamification_goal(osv.Model): goal = all_goals[goal_id] # check goal target reached - if (goal.definition_condition == 'higher' and value.get('current', goal.current) >= goal.target_goal) \ - or (goal.definition_condition == 'lower' and value.get('current', goal.current) <= goal.target_goal): + if (goal.definition_id.condition == 'higher' and value.get('current', goal.current) >= goal.target_goal) \ + or (goal.definition_id.condition == 'lower' and value.get('current', goal.current) <= goal.target_goal): value['state'] = 'reached' # check goal failure