Merge pull request !9017 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2026-02-26 08:48:45 +00:00
committed by Gitee
+4 -3
View File
@@ -215,15 +215,16 @@ class HrLeave(models.Model):
def _compute_duration(self):
super()._compute_duration()
for holiday in self:
# 如果是自然日:(按小时请假)
# 如果是自然日:
if holiday.holiday_status_id.type_of_work == "1":
if holiday.request_date_from and holiday.request_date_to:
if holiday.batch_id:
days = (holiday.request_date_to - holiday.request_date_from).days + 1
hours = days * 8
else:
hours = 0.0
hours = (float(holiday.request_hour_to) - float(holiday.request_hour_from))
holiday.number_of_hours = hours
holiday.leave_hours = hours
if holiday.holiday_status_id.type_of_work == "0":
if holiday.request_hour_from and holiday.request_hour_to:
start_hour = float(holiday.request_hour_from)