diff --git a/yuthon_salary/models/yuthon_salary_active.py b/yuthon_salary/models/yuthon_salary_active.py index 27a278d1e..f49104f3c 100644 --- a/yuthon_salary/models/yuthon_salary_active.py +++ b/yuthon_salary/models/yuthon_salary_active.py @@ -78,29 +78,27 @@ class YuthonSalaryActive(models.Model): reimbursed_medical_exam_fee = fields.Float(string='已报销体检费') remaining_medical_exam_fee = fields.Float(string='剩余体检费') - def payslip_wizard(self): - return { - "type": "ir.actions.act_window", - "name": "工资条发送", - "res_model": "payslip.send.wizard", - "view_mode": "form", - "target": "new", - "context": { - 'default_employee_id': self.employee_id.id, - } - } + def salary_confirm(self): + 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}月的薪资条已经发放,请到手机端查看", + ) + self.write({'confirm_status': 'un_confirm'}) def open_archive_record(self): + tree_id = self.env.ref("yuthon_salary.view_yuthon_salary_active_tree").id return { 'name': '工资条', 'type': 'ir.actions.act_window', 'res_model': 'yuthon.salary.active', + 'views': [[tree_id, 'tree']], 'view_mode': 'tree', 'domain': [('employee_id', '=', self.employee_id.id)], } - def _get_default_month(self): current_month = datetime.now().month return str(current_month) \ No newline at end of file diff --git a/yuthon_salary/views/yuthon_salary_active_views.xml b/yuthon_salary/views/yuthon_salary_active_views.xml index 6b5040c18..3380abe87 100644 --- a/yuthon_salary/views/yuthon_salary_active_views.xml +++ b/yuthon_salary/views/yuthon_salary_active_views.xml @@ -6,7 +6,7 @@ -