From 3277750abcf2a28df52970c289bef19f3501d4b0 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:41:48 +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 | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index 9640e5a07..ef18d19b0 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -733,13 +733,20 @@ class AppletAttendance(Controller): else: check_out_str = '' if is_weekend else '缺卡' + has_leave_batch_workflow = False + if hasattr(att, 'workflow_id') and att.workflow_id: + if att.workflow_id.res_model == 'hr.leave.batch': + has_leave_batch_workflow = True + if not check_in_status and not check_out_status: color_select = 3 else: - has_exception = (check_in_status in ['迟到', '早退', '缺卡', '旷工']) or ( - check_out_status in ['迟到', '早退', '缺卡', '旷工']) - - color_select = 2 if has_exception else 1 + if has_leave_batch_workflow: + color_select = 1 + else: + has_exception = (check_in_status in ['迟到', '早退', '缺卡', '旷工']) or ( + check_out_status in ['迟到', '早退', '缺卡', '旷工']) + color_select = 2 if has_exception else 1 records.append({ 'date': att.current_data.strftime('%Y/%m/%d'),