From 83604432a3815e0f8589c33b001a0d19032121e1 Mon Sep 17 00:00:00 2001 From: Renzo Meister Date: Sun, 10 Mar 2019 18:28:59 +0100 Subject: [PATCH] [FIX] Display always 2 Month (61 days) and do not translate !important otherwise colors are not displayed and when printing from march 1st, you will only see april 29, but not april 30. --- addons/hr_holidays/i18n/de.po | 2 +- addons/hr_holidays/report/holidays_summary_report.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/hr_holidays/i18n/de.po b/addons/hr_holidays/i18n/de.po index c74d3f7fc9..6ce02fccfc 100644 --- a/addons/hr_holidays/i18n/de.po +++ b/addons/hr_holidays/i18n/de.po @@ -35,7 +35,7 @@ msgstr "" #. module: hr_holidays #: model:ir.ui.view,arch_db:hr_holidays.report_holidayssummary msgid "!important ></td>" -msgstr "!wichtig ></td>" +msgstr "!important ></td>" #. module: hr_holidays #: model:ir.ui.view,arch_db:hr_holidays.report_holidayssummary diff --git a/addons/hr_holidays/report/holidays_summary_report.py b/addons/hr_holidays/report/holidays_summary_report.py index 07c221a7d1..16128efb90 100644 --- a/addons/hr_holidays/report/holidays_summary_report.py +++ b/addons/hr_holidays/report/holidays_summary_report.py @@ -16,7 +16,7 @@ class HrHolidaySummaryReport(models.AbstractModel): st_date = fields.Date.from_string(start_date) return { 'start_date': fields.Date.to_string(st_date), - 'end_date': fields.Date.to_string(st_date + relativedelta(days=59)), + 'end_date': fields.Date.to_string(st_date + relativedelta(days=60)), 'holiday_type': 'Confirmed and Approved' if holiday_type == 'both' else holiday_type } @@ -26,7 +26,7 @@ class HrHolidaySummaryReport(models.AbstractModel): def _get_day(self, start_date): res = [] start_date = fields.Date.from_string(start_date) - for x in range(0, 60): + for x in range(0, 61): color = '#ababab' if self._date_is_day_off(start_date) else '' res.append({'day_str': start_date.strftime('%a'), 'day': start_date.day , 'color': color}) start_date = start_date + relativedelta(days=1) @@ -36,7 +36,7 @@ class HrHolidaySummaryReport(models.AbstractModel): # it works for geting month name between two dates. res = [] start_date = fields.Date.from_string(start_date) - end_date = start_date + relativedelta(days=59) + end_date = start_date + relativedelta(days=60) while start_date <= end_date: last_date = start_date + relativedelta(day=1, months=+1, days=-1) if last_date > end_date: @@ -50,8 +50,8 @@ class HrHolidaySummaryReport(models.AbstractModel): res = [] count = 0 start_date = fields.Date.from_string(start_date) - end_date = start_date + relativedelta(days=59) - for index in range(0, 60): + end_date = start_date + relativedelta(days=60) + for index in range(0, 61): current = start_date + timedelta(index) res.append({'day': current.day, 'color': ''}) if self._date_is_day_off(current) :