添加功能

This commit is contained in:
李鹏宇
2026-03-02 11:11:22 +08:00
parent 52a814e482
commit 9779d19daf
+6 -2
View File
@@ -341,8 +341,12 @@ class HrAttendance(models.Model):
title = '【本月考勤异常提醒】'
else:
continue
url = f'https://phone.thtzjt.com/phone/AttendanceSummary/{fields.date.today().year}/{fields.date.today().month}/{emp.user_id.id}'
today = fields.date.today()
if today.month == 1:
last_month = fields.date(today.year - 1, 12, 1)
else:
last_month = fields.date(today.year, today.month - 1, 1)
url = f'https://phone.thtzjt.com/phone/AttendanceSummary/{last_month.year}/{last_month.month}/{emp.user_id.id}'
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='att',
user_id=emp.wecom_userid,
title=f'【{title}】',