Merge branch 'bugfix/holiday_summary_department' into 'master'

[FIX] hr_holidays: Display always 2 Months (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.

See merge request flectra-hq/flectra!200
This commit is contained in:
Parthiv Patel committed 2019-03-11 05:02:40 +00:00
commit 36d9670f0a
2 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -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
@@ -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) :