diff --git a/fiscalyear.py b/fiscalyear.py index 80e52d502f..c64470eb06 100644 --- a/fiscalyear.py +++ b/fiscalyear.py @@ -3,7 +3,6 @@ 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 @@ -92,10 +91,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.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')) + 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') while period_start_date < end_date: period_end_date = period_start_date + \ mx.DateTime.RelativeDateTime(months=interval)