From cc52f99a0e1cc758c819691ec3b1789f4e4e90c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 14 Jun 2008 12:31:59 +0200 Subject: [PATCH] Remove call to mx.DateTime.strptime for version 3.0 --- fiscalyear.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fiscalyear.py b/fiscalyear.py index c64470eb06..80e52d502f 100644 --- a/fiscalyear.py +++ b/fiscalyear.py @@ -3,6 +3,7 @@ from trytond.osv import fields, OSV, ExceptORM from trytond.wizard import Wizard, WizardOSV, ExceptWizard import mx.DateTime +import time import datetime from decimal import Decimal @@ -91,10 +92,10 @@ class FiscalYear(OSV): ''' period_obj = self.pool.get('account.period') for fiscalyear in self.browse(cursor, user, ids, context=context): - end_date = mx.DateTime.strptime(str(fiscalyear.end_date), - '%Y-%m-%d') - period_start_date = mx.DateTime.strptime(str(fiscalyear.start_date), - '%Y-%m-%d') + end_date = mx.DateTime.mktime(time.strptime( + str(fiscalyear.end_date), '%Y-%m-%d')) + period_start_date = mx.DateTime.mktime(time.strptime( + str(fiscalyear.start_date), '%Y-%m-%d')) while period_start_date < end_date: period_end_date = period_start_date + \ mx.DateTime.RelativeDateTime(months=interval)