diff --git a/yuthon_salary/models/yuthon_salary_active.py b/yuthon_salary/models/yuthon_salary_active.py index 6828db7a1..c3800762a 100644 --- a/yuthon_salary/models/yuthon_salary_active.py +++ b/yuthon_salary/models/yuthon_salary_active.py @@ -89,16 +89,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 eba587afe..7a367b745 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 +
+