[FIX] gamification: close challenge after expiration

Before this patch, the challenges with an end date in the future were closed at
the first cron run.

opw-669995
This commit is contained in:
Martin Trigaux
2016-03-10 09:26:17 +01:00
parent 560e5eec15
commit abe5859559
+1 -1
View File
@@ -276,7 +276,7 @@ class gamification_challenge(osv.Model):
# close scheduled challenges
planned_challenge_ids = self.search(cr, uid, [
('state', '=', 'inprogress'),
('end_date', '>=', fields.date.today())])
('end_date', '<', fields.date.today())])
if planned_challenge_ids:
self.write(cr, uid, planned_challenge_ids, {'state': 'done'}, context=context)