From eeb6d2ea0be30c115c287a101ff9e672aafa7aa7 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 13 Mar 2013 11:49:00 +0100 Subject: [PATCH] [FIX] next report date and isoformat bzr revid: mat@openerp.com-20130313104900-5h306omqclwfgqmi --- addons/gamification/plan.py | 9 ++++++--- 1 file 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':