From 95cd3cf68ba3a350d4f0cb69af646d3c8560364b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Thu, 12 Mar 2026 14:55:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_holiday/models/inherit_hr_leave.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py index 0dd3e2bf6..c26549f38 100644 --- a/yuthon_holiday/models/inherit_hr_leave.py +++ b/yuthon_holiday/models/inherit_hr_leave.py @@ -946,8 +946,7 @@ class HolidaysRequestBatch(models.Model): raise UserError( _(f"天河物管休假时长必须为 2、4、6 或 8 小时才可以保存!") ) - leave_days = 0.0 - overtime_days = 0.0 + total_annual_leave_days = 0.0 # 年假总天数 total_compensatory_leave_days = 0.0 # 补休总天数 for leave_line in record.leave_ids: @@ -959,9 +958,9 @@ class HolidaysRequestBatch(models.Model): for hour_leave_line in record.hour_leave_ids: leave_hours = float(hour_leave_line.leave_hours or 0) leave_days = leave_hours / 8 - if hour_leave_line.holiday_status_id == '年假': + if hour_leave_line.holiday_status_id.name == '年假': total_annual_leave_days += leave_days - elif hour_leave_line.holiday_status_id == '补休': + elif hour_leave_line.holiday_status_id.name == '补休': total_compensatory_leave_days += leave_days if total_annual_leave_days > self.remaining_annual_leave: