From 967aa6ffbe7bc8e26b7accf9fc8edce554eb4dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 22 Nov 2008 14:53:02 +0100 Subject: [PATCH] Fix period name for issue600 --- fiscalyear.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fiscalyear.py b/fiscalyear.py index 2c37fd61a7..e9f52cae6f 100644 --- a/fiscalyear.py +++ b/fiscalyear.py @@ -136,9 +136,11 @@ class FiscalYear(OSV): mx.DateTime.RelativeDateTime(days=1) if period_end_date > end_date: period_end_date = end_date + name = period_start_date.strftime('%Y-%m') + if name != period_end_date.strftime('%Y-%m'): + name += ' - ' + period_end_date.strftime('%Y-%m') period_obj.create(cursor, user, { - 'name': period_start_date.strftime('%Y-%m') + ' - ' + \ - period_end_date.strftime('%Y-%m'), + 'name': name, 'start_date': period_start_date.strftime('%Y-%m-%d'), 'end_date': period_end_date.strftime('%Y-%m-%d'), 'fiscalyear': fiscalyear.id,