!4073 添加功能

Merge pull request !4073 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2025-07-25 07:17:16 +00:00
committed by Gitee
+7 -3
View File
@@ -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'