summaryrefslogtreecommitdiff
path: root/addons/gamification
diff options
context:
space:
mode:
authorMartin Trigaux <mat@openerp.com>2013-03-13 11:49:00 +0100
committerMartin Trigaux <mat@openerp.com>2013-03-13 11:49:00 +0100
commiteeb6d2ea0be30c115c287a101ff9e672aafa7aa7 (patch)
treed4a69bb7635afd6835a226efabef8f806c2c57c4 /addons/gamification
parent25d6dc30a8367af5ab3df51ef760005afea9370a (diff)
[FIX] next report date and isoformat
bzr revid: mat@openerp.com-20130313104900-5h306omqclwfgqmi
Diffstat (limited to 'addons/gamification')
-rw-r--r--addons/gamification/plan.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/addons/gamification/plan.py b/addons/gamification/plan.py
index 06323f65597..856c19598ad 100644
--- a/addons/gamification/plan.py
+++ b/addons/gamification/plan.py
@@ -76,12 +76,15 @@ class gamification_goal_plan(osv.Model):
for plan in self.browse(cr, uid, ids, context):
last = datetime.strptime(plan.last_report_date, '%Y-%m-%d').date()
if plan.report_message_frequency == 'daily':
- res[plan.id] = last + timedelta(days=1).isoformat()
+ next = last + timedelta(days=1)
+ res[plan.id] = next.isoformat()
elif plan.report_message_frequency == 'weekly':
- res[plan.id] = last + timedelta(days=7).isoformat()
+ next = last + timedelta(days=7)
+ res[plan.id] = next.isoformat()
elif plan.report_message_frequency == 'monthly':
month_range = calendar.monthrange(last.year, last.month)
- res[plan.id] = last.replace(day=month_range[1]) + timedelta(days=1).isoformat()
+ next = last.replace(day=month_range[1]) + timedelta(days=1)
+ res[plan.id] = next.isoformat()
elif plan.report_message_frequency == 'yearly':
res[plan.id] = last.replace(year=last.year + 1).isoformat()
else: # frequency == 'once':