添加功能

This commit is contained in:
李鹏宇
2026-08-14 15:50:57 +08:00
parent a06bd8fb9a
commit 39c6d5b3f0
2 changed files with 5 additions and 5 deletions
@@ -181,11 +181,11 @@ class AppletAttendance(Controller):
if attendance_id.workflow_id and attendance_id.workflow_id.res_model in ['hr.leave.batch', 'go.approval']:
has_leave_batch_workflow = True
check_in_html = f'<p style="color:green">{check_in_str}</p>' if has_leave_batch_workflow else (
check_in_html = f'<p style="color:green">{check_in_str}</p>' if (has_leave_batch_workflow or shift_name == '外派') 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 (
check_out_html = f'<p style="color:green">{check_out_str}</p>' if (has_leave_batch_workflow or shift_name == '外派') 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>'
)
@@ -304,7 +304,7 @@ class AppletAttendance(Controller):
check_in_html = (
f'<p style="color:green">{check_in_str}</p>'
if has_leave_batch_workflow
if has_leave_batch_workflow or shift_name == '外派'
else (
f'<p style="color:red">{check_in_str}</p>'
if check_in_status in ['迟到', '早退', '缺卡']
@@ -313,7 +313,7 @@ class AppletAttendance(Controller):
)
check_out_html = (
f'<p style="color:green">{check_out_str}</p>'
if has_leave_batch_workflow
if has_leave_batch_workflow or shift_name == '外派'
else (
f'<p style="color:red">{check_out_str}</p>'
if check_out_status in ['迟到', '早退', '缺卡']
+1 -1
View File
@@ -102,7 +102,7 @@ class CustomerPortal(portal.CustomerPortal):
# 'pending_tip': pending_tip if has_pending else '',
'日期': record.display_date,
'应到': format_vacation_value(record.should_attendance, '天'),
'实到': f"{record.actual_attendance}天",
'实到': format_vacation_value(record.actual_attendance, '天'),
'外派': format_vacation_value(record.expatriation, '天'),
'迟到': format_vacation_value(record.is_late_card, '次'),
'早退': format_vacation_value(record.is_early_card, '次'),