From 711106bbd6f4a8b72fd4ee7a5cfadf11d1cccbd8 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Fri, 25 Jul 2025 15:16:12 +0800 Subject: [PATCH 1/2] =?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 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py index c7b9cddc8..162226515 100644 --- a/yuthon_holiday/models/inherit_hr_leave.py +++ b/yuthon_holiday/models/inherit_hr_leave.py @@ -609,9 +609,14 @@ class HolidaysRequestBatch(models.Model): for record in self: reports_id = self.env['yuthon.vacation.reports'].search([('employee_id', '=', record.users_id.employee_id.id)]) if reports_id: - leave = round(reports_id.leave / 8, 1) - working_overtime = round(reports_id.working_overtime / 8, 1) - record.holiday_allowance = (f"年假{leave}天, 补休{working_overtime}天") + leave_hours_str = reports_id.leave.split('小时')[0].strip() + leave_hours = float(leave_hours_str) + leave_days = leave_hours / 8 + overtime_hours_str = reports_id.working_overtime.split('小时')[0].strip() + overtime_hours = float(overtime_hours_str) + overtime_days = overtime_hours / 8 + # 拼接最终显示文本 + record.holiday_allowance = f"年假{leave_days:.1f}天, 补休{overtime_days:.1f}天" class HrLeaveLine(models.Model): _name = 'hr.leave.line' From 69012f777680c3aa11905c7a7bea27ce8f83f370 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Fri, 25 Jul 2025 15:16:28 +0800 Subject: [PATCH 2/2] =?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 | 1 - 1 file changed, 1 deletion(-) diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py index 162226515..4a01aa774 100644 --- a/yuthon_holiday/models/inherit_hr_leave.py +++ b/yuthon_holiday/models/inherit_hr_leave.py @@ -615,7 +615,6 @@ class HolidaysRequestBatch(models.Model): overtime_hours_str = reports_id.working_overtime.split('小时')[0].strip() overtime_hours = float(overtime_hours_str) overtime_days = overtime_hours / 8 - # 拼接最终显示文本 record.holiday_allowance = f"年假{leave_days:.1f}天, 补休{overtime_days:.1f}天" class HrLeaveLine(models.Model):