[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-09 15:35:29 +01:00
parent 560e5eec15
commit abe5859559
1 changed files with 1 additions and 1 deletions

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)