summaryrefslogtreecommitdiff
path: root/addons/gamification/models
diff options
context:
space:
mode:
authorChristophe Simonis <chs@openerp.com>2014-04-24 15:45:33 +0200
committerChristophe Simonis <chs@openerp.com>2014-04-24 15:45:33 +0200
commit7a7d7febf8d51cdc693e77678fc9eaee3864b3b2 (patch)
treed2bb635b1441f04267727e39a4bfbd219a4b7b6b /addons/gamification/models
parent96b9d8b9d59dc7b240a096e6c6775c7a45ac88c4 (diff)
parent52cfc16c2e2f33395a53b255825a8153ec80ce40 (diff)
[MERGE] forward port of branch saas-3 up to revid 9429 chs@openerp.com-20140424123538-rxk9got9k2on1ki1
bzr revid: chs@openerp.com-20140424131824-4ksluvhnegp7kplb bzr revid: chs@openerp.com-20140424134533-lhhcd32n3s0m9cqk
Diffstat (limited to 'addons/gamification/models')
-rw-r--r--addons/gamification/models/challenge.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py
index a0c4b638ae3..ecb4c495d94 100644
--- a/addons/gamification/models/challenge.py
+++ b/addons/gamification/models/challenge.py
@@ -200,7 +200,6 @@ class gamification_challenge(osv.Model):
'visibility_mode': 'personal',
'report_message_frequency': 'never',
'last_report_date': fields.date.today,
- 'start_date': fields.date.today,
'manager_id': lambda s, cr, uid, c: uid,
'category': 'hr',
'reward_failure': False,
@@ -269,13 +268,15 @@ class gamification_challenge(osv.Model):
planned_challenge_ids = self.search(cr, uid, [
('state', '=', 'draft'),
('start_date', '<=', fields.date.today())])
- self.write(cr, uid, planned_challenge_ids, {'state': 'inprogress'}, context=context)
+ if planned_challenge_ids:
+ self.write(cr, uid, planned_challenge_ids, {'state': 'inprogress'}, context=context)
# close scheduled challenges
planned_challenge_ids = self.search(cr, uid, [
('state', '=', 'inprogress'),
('end_date', '>=', fields.date.today())])
- self.write(cr, uid, planned_challenge_ids, {'state': 'done'}, context=context)
+ if planned_challenge_ids:
+ self.write(cr, uid, planned_challenge_ids, {'state': 'done'}, context=context)
if not ids:
ids = self.search(cr, uid, [('state', '=', 'inprogress')], context=context)