From 9b87bf5723e5981702feb974eff0f108f058488b 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, 26 Jan 2026 18:06:27 +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_salary/models/yuthon_salary_active.py | 20 +++++++++++++------ .../views/yuthon_salary_active_views.xml | 5 ++++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/yuthon_salary/models/yuthon_salary_active.py b/yuthon_salary/models/yuthon_salary_active.py index feb7b2511..e709e2bf7 100644 --- a/yuthon_salary/models/yuthon_salary_active.py +++ b/yuthon_salary/models/yuthon_salary_active.py @@ -88,16 +88,24 @@ class YuthonSalaryActive(models.Model): self.write({'confirm_status': 'confirm'}) def payslip_transmit(self): - self.sudo().env["wecom.apps"].sync_send_message( - category='att', user_id=self.employee_id.wecom_userid, - message=f"你{self.select_year}年{self.select_time}月的薪资条已经发放,请到手机端查看", + url="https://phone.thtzjt.com/phone/Salary/153/23" + self.sudo().env["wecom.apps"].sync_send_message_textcard( + category='salary', user_id=self.employee_id.wecom_userid, + url=url,title='工资条', description=f"{self.select_year}年{self.select_time}月的薪资条已经发放", btntxt = "查看详情" ) - self.sudo().env["wecom.apps"].sync_send_message( - category='att', user_id="18562027762", - message=f"你{self.select_year}年{self.select_time}月的薪资条已经发放,请到手机端查看", + self.sudo().env["wecom.apps"].sync_send_message_textcard( + category='salary', user_id='18562027762', + url=url, title='工资条', description=f"{self.select_year}年{self.select_time}月的薪资条已经发放", + btntxt="查看详情" ) self.write({'confirm_status': 'un_confirm'}) + def all_payslip_transmit(self): + salary_ids = self.env["yuthon.salary.active"].browse( + self._context.get('active_ids', self._context.get('active_id'))) + for rec in salary_ids: + rec.payslip_transmit() + def open_archive_record(self): self.ensure_one() float_fields_with_value = [] diff --git a/yuthon_salary/views/yuthon_salary_active_views.xml b/yuthon_salary/views/yuthon_salary_active_views.xml index 5cc4b4828..a252bf83f 100644 --- a/yuthon_salary/views/yuthon_salary_active_views.xml +++ b/yuthon_salary/views/yuthon_salary_active_views.xml @@ -3,8 +3,11 @@ yuthon.salary.active.tree yuthon.salary.active - + all_payslip_transmit +
+