!9032 添加功能

Merge pull request !9032 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2026-02-26 11:24:40 +00:00
committed by Gitee
@@ -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'<p style="color:red">{check_in_str}</p>' if check_in_status in ['迟到', '早退',
'缺卡'] else f'<p style="color:green">{check_in_str}</p>'
check_out_html = f'<p style="color:red">{check_out_str}</p>' if check_out_status in ['迟到', '早退',
'缺卡'] else f'<p style="color:green">{check_out_str}</p>'
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'<p style="color:green">{check_in_str}</p>'
if has_leave_batch_workflow
else (
f'<p style="color:red">{check_in_str}</p>'
if check_in_status in ['迟到', '早退', '缺卡']
else f'<p style="color:green">{check_in_str}</p>'
)
)
check_out_html = (
f'<p style="color:green">{check_out_str}</p>'
if has_leave_batch_workflow
else (
f'<p style="color:red">{check_out_str}</p>'
if check_out_status in ['迟到', '早退', '缺卡']
else f'<p style="color:green">{check_out_str}</p>'
)
)
if self.is_workday(current_date):
attendance_id_class = f"{shift_name} {start_time_str}-{end_time_str}"