[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:
parent
560e5eec15
commit
abe5859559
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue