From 3b074c4168306e6ae305753e257f32091b0adca1 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: Fri, 14 Aug 2026 18:33:37 +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_hr_attendance/controllers/applet_attendance.py | 2 +- yuthon_hr_attendance/models/yuthon_vacation_reports.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index 46d6af2b1..d16289b27 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -299,7 +299,7 @@ class AppletAttendance(Controller): check_out_str = check_out.strftime('%H:%M:%S') if check_out else ' ' has_leave_batch_workflow = False if hasattr(attendance_id, 'workflow_id') and attendance_id.workflow_id: - if attendance_id.workflow_id.res_model in ['hr.leave.batch', 'go.approval']: + if attendance_id.workflow_id.res_model in ['hr.leave.batch', 'go.approval', 'card.approval']: has_leave_batch_workflow = True check_in_html = ( diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 93a0a6c74..9bdda7add 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -1036,7 +1036,10 @@ class YuthonVacationReports(models.Model): if att.is_abnormal: is_abnormal += 1 # 5. 计算应到天数(适配外派) - contract = employee.contract_id + # 取员工最早的合同(含已中止),从最早入职时间开始统计应到天数 + contract = self.env['hr.contract'].search([ + ('employee_id', '=', employee.id), + ], order='date_start asc, id asc', limit=1) if is_outside: if exp_has_return and exp_end_return: work_days = rec._create_leave_record(employee, exp_end_return + timedelta(days=1), month_end)