From 351feb031cf6fd9131406c8bcf66fcaafa331b5f 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, 26 Feb 2026 19:23:59 +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 --- .../controllers/applet_attendance.py | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index 24ad3374d..9640e5a07 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -295,10 +295,29 @@ class AppletAttendance(Controller): state_result = '缺卡' check_in_str = check_in.strftime('%H:%M:%S') if check_in else ' ' check_out_str = check_out.strftime('%H:%M:%S') if check_out else ' ' - check_in_html = f'

{check_in_str}

' if check_in_status in ['迟到', '早退', - '缺卡'] else f'

{check_in_str}

' - check_out_html = f'

{check_out_str}

' if check_out_status in ['迟到', '早退', - '缺卡'] else f'

{check_out_str}

' + has_leave_batch_workflow = False + if hasattr(attendance_id, 'workflow_id') and attendance_id.workflow_id: + if attendance_id.workflow_id.res_model == 'hr.leave.batch': + has_leave_batch_workflow = True + + check_in_html = ( + f'

{check_in_str}

' + if has_leave_batch_workflow + else ( + f'

{check_in_str}

' + if check_in_status in ['迟到', '早退', '缺卡'] + else f'

{check_in_str}

' + ) + ) + check_out_html = ( + f'

{check_out_str}

' + if has_leave_batch_workflow + else ( + f'

{check_out_str}

' + if check_out_status in ['迟到', '早退', '缺卡'] + else f'

{check_out_str}

' + ) + ) if self.is_workday(current_date): attendance_id_class = f"{shift_name} {start_time_str}-{end_time_str}"