From 9779d19daf9fbf2def9490bd7469ba2bd6ab3ea2 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: Mon, 2 Mar 2026 11:11:22 +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 --- yuthon_hr_attendance/models/hr_attendance.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index 8d7e92267..26faf8b82 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -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}】',