From 551744fbaa9cc01f2e69a0f669c66d8409fe0f36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 31 Oct 2018 18:15:57 +0100 Subject: [PATCH] Remove custom strftime for year before 1900 The bug has been fixed in Python 3.3 issue7814 review48671002 --- fiscalyear.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fiscalyear.py b/fiscalyear.py index ede8bee3b8..0d12d86567 100644 --- a/fiscalyear.py +++ b/fiscalyear.py @@ -4,7 +4,6 @@ from dateutil.relativedelta import relativedelta from trytond.model import ModelView, ModelSQL, Workflow, fields from trytond.wizard import Wizard, StateView, StateAction, Button -from trytond.tools import datetime_strftime from trytond.pyson import Eval, If, PYSONEncoder from trytond.transaction import Transaction from trytond.pool import Pool @@ -194,9 +193,9 @@ class FiscalYear(Workflow, ModelSQL, ModelView): relativedelta(day=31) if period_end_date > fiscalyear.end_date: period_end_date = fiscalyear.end_date - name = datetime_strftime(period_start_date, '%Y-%m') - if name != datetime_strftime(period_end_date, '%Y-%m'): - name += ' - ' + datetime_strftime(period_end_date, '%Y-%m') + name = period_start_date.strftime('%Y-%m') + if name != period_end_date.strftime('%Y-%m'): + name += ' - ' + period_end_date.strftime('%Y-%m') to_create.append({ 'name': name, 'start_date': period_start_date,