From 40673172adcf993069197d3cb12199c875a6a9ee 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: Wed, 8 Apr 2026 10:03:15 +0800 Subject: [PATCH 1/3] =?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/yuthon_vacation_reports.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index c1978ebb7..86d55cd71 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -1250,7 +1250,6 @@ class YuthonVacationReports(models.Model): today = fields.Date.today() first_day = today.replace(day=1) current_date = first_day - first_workday = None while True: if self._process_shift_days(current_date): first_workday = current_date @@ -1264,7 +1263,9 @@ class YuthonVacationReports(models.Model): ('vacation_state', '=', 'not_sent'), ]) for report in report_objs: - report.button_put() + resource_user_ids = report.employee_id.resource_calendar_id.resource_user_ids.ids + if report.employee_id.id not in resource_user_ids: + report.button_put() def button_put(self): we_id = self.employee_id.wecom_userid From d8c1ad97815ce14d795017e22cc50f3897b5b138 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: Wed, 8 Apr 2026 10:29:34 +0800 Subject: [PATCH 2/3] =?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 | 12 ++++++------ .../models/yuthon_vacation_reports.py | 5 ++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index 25875271f..ab27d4545 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -370,12 +370,12 @@ class HrAttendance(models.Model): description='考勤异常请尽快处理', exception_alerts = True, url=url, btntxt="查看详情") - # self.sudo().env["wecom.apps"].sync_send_message_textcard(category='att', - # user_id='18562027762', - # title='【考勤异常提醒】', - # exception_alerts=True, - # description='考勤异常请尽快处理', - # url=url, btntxt="查看详情") + self.sudo().env["wecom.apps"].sync_send_message_textcard(category='att', + user_id='18562027762', + title='【考勤异常提醒】', + exception_alerts=True, + description='考勤异常请尽快处理', + url=url, btntxt="查看详情") def missing_card_judgment(self): today = fields.Date.today() diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 86d55cd71..efa6189c3 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -1255,6 +1255,7 @@ class YuthonVacationReports(models.Model): first_workday = current_date break current_date += timedelta(days=1) + if today != first_workday: return last_month_first = first_day - relativedelta(months=1) @@ -1264,7 +1265,9 @@ class YuthonVacationReports(models.Model): ]) for report in report_objs: resource_user_ids = report.employee_id.resource_calendar_id.resource_user_ids.ids - if report.employee_id.id not in resource_user_ids: + if report.employee_id.id in resource_user_ids: + report.write({'vacation_state': 'confirmed'}) + else: report.button_put() def button_put(self): From 79b16cde987b2e84410d4509cc748bd66c2bd109 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: Wed, 8 Apr 2026 10:40:45 +0800 Subject: [PATCH 3/3] =?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/yuthon_vacation_reports.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index efa6189c3..d36e15f60 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -1337,7 +1337,7 @@ class YuthonVacationReports(models.Model): url = f'https://phone.thtzjt.com/phone/Notarize/{rec.id}/{rec.employee_id.user_id.id}' data = f"你{year}年{month}月的考勤确认单已经生成,请确认" self.sudo().env["wecom.apps"].sync_send_message_textcard(category='att_ok', user_id=we_id, title="考勤确认单", description=data, url=url, btntxt="详细信息") - self.sudo().env["wecom.apps"].sync_send_message_textcard(category='att_ok', user_id="18562027762", title="考勤确认单", description=data, url=url, btntxt="详细信息") + # self.sudo().env["wecom.apps"].sync_send_message_textcard(category='att_ok', user_id="18562027762", title="考勤确认单", description=data, url=url, btntxt="详细信息") rec.write({'vacation_state': 'pending'}) return { 'type': 'ir.actions.client',