Browse Source

Use 0.5 for half-days instead of 0.25.

master
Tobias Herre 5 months ago
parent
commit
5077bef37c
  1. 8
      itis_hr_leave_extend/models/hr_holiday.py

8
itis_hr_leave_extend/models/hr_holiday.py

@ -291,10 +291,10 @@ class HRHoliday(models.Model):
if cont_start_date <= temp_date:
if self.get_hours(weekday, contract.working_hours.attendance_ids) > 0.0:
if temp_date == date_from and self.leave_selection =='half_day':
res += 0.25
res += 0.5
break
if temp_date == date_to and self.leave_selection_date_to =='half_day':
res += 0.25
res += 0.5
break
res += 1
else:
@ -303,10 +303,10 @@ class HRHoliday(models.Model):
if cont_start_date <= temp_date and cont_end_date >= temp_date:
if self.get_hours(weekday, contract.working_hours.attendance_ids) > 0.0:
if temp_date == date_from and self.leave_selection =='half_day':
res += 0.25
res += 0.5
break
if temp_date == date_to and self.leave_selection_date_to =='half_day':
res += 0.25
res += 0.5
break
res += 1
temp_date += timedelta(days=1)

Loading…
Cancel
Save