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}"