diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py index c7b9cddc8..4a01aa774 100644 --- a/yuthon_holiday/models/inherit_hr_leave.py +++ b/yuthon_holiday/models/inherit_hr_leave.py @@ -609,9 +609,13 @@ 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'