From 6d30f13d5a3ea271c5f093283c14bb0c719ca1af Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Sat, 22 Mar 2025 18:58:03 +0800 Subject: [PATCH 1/2] =?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 --- .../models/yuthon_hr_employee.py | 2 +- yuthon_salary/models/inherit_hr_payslip.py | 44 +++++++++++++- yuthon_salary/security/ir.model.access.csv | 4 +- .../views/inherit_hr_payslip_views.xml | 60 +++++++++++++++---- yuthon_salary/wizard/put_return_wizard.py | 39 ++++++++++-- .../wizard/put_return_wizard_viwes.xml | 38 ++++++++++++ yuthon_work_brand/views/hr_menus.xml | 1 + 7 files changed, 168 insertions(+), 20 deletions(-) diff --git a/yuthon_hr_employee/models/yuthon_hr_employee.py b/yuthon_hr_employee/models/yuthon_hr_employee.py index e5d754909..0a3215461 100644 --- a/yuthon_hr_employee/models/yuthon_hr_employee.py +++ b/yuthon_hr_employee/models/yuthon_hr_employee.py @@ -43,7 +43,7 @@ class YuthonHrEmployee(models.Model): # 个人信息 user_salary = fields.Float(string="基本工资") job_lv_salary = fields.Float(string="职级工资") - salary_group_id = fields.Many2one('yuthon.salary.group', string="工资单分组") + salary_group_id = fields.Many2one('yuthon.salary.group', string="工资单分组", store=True, index=True) user_sex = fields.Selection([('girl', '女'), ('boy', '男')], string="性别") diff --git a/yuthon_salary/models/inherit_hr_payslip.py b/yuthon_salary/models/inherit_hr_payslip.py index d7eeef769..c0a95afd2 100644 --- a/yuthon_salary/models/inherit_hr_payslip.py +++ b/yuthon_salary/models/inherit_hr_payslip.py @@ -7,6 +7,7 @@ class InheritHrPayslip(models.Model): base_salary = fields.Float(string='基本工资', compute='_compute_salary', store=True) yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储')], related='employee_id.yuthon_company', string="所属公司") + salary_group_id = fields.Many2one(related='employee_id.salary_group_id', string="工资组", store=True, index=True) performance_bonuses = fields.Float(string='预发绩效奖金', compute='_compute_salary', store=True) full_attendance_award = fields.Float(string='全勤奖', compute='_compute_salary', store=True) commuting_allowance = fields.Float(string='通信补贴', compute='_compute_salary', store=True) @@ -45,6 +46,7 @@ class InheritHrPayslip(models.Model): attendance_deduction_total = fields.Float(string='考勤扣款合计') assessment_reserved_amount = fields.Float(string='考核保留量') is_push = fields.Boolean(string='推送') + is_salary_push = fields.Boolean(string='工资推送') @api.depends('line_ids') def _compute_salary(self): @@ -149,10 +151,50 @@ class InheritHrPayslip(models.Model): for record in self: record.write({'is_push': True}) - def return_button(self): for record in self: record.write({'is_push': False}) + def put_salary_button(self): + for record in self: + record.write({'is_salary_push': True}) + def return_salary_button(self): + for record in self: + record.write({'is_salary_push': False}) + def action_put_wizard(self): + return { + "type": "ir.actions.act_window", + "name": "推送个税计算", + "res_model": "put.wizard", + "view_mode": "form", + "target": "new", + } + + def action_return_wizard(self): + return { + "type": "ir.actions.act_window", + "name": "退回薪资计算", + "res_model": "return.wizard", + "view_mode": "form", + "target": "new", + } + + def action_put_salary_wizard(self): + return { + "type": "ir.actions.act_window", + "name": "推送工资确认", + "res_model": "put.salary.wizard", + "view_mode": "form", + "target": "new", + } + + def action_return_salary_wizard(self): + return { + "type": "ir.actions.act_window", + "name": "退回个税计算", + "res_model": "return.salary.wizard", + "view_mode": "form", + "target": "new", + } diff --git a/yuthon_salary/security/ir.model.access.csv b/yuthon_salary/security/ir.model.access.csv index e1c59dfab..13c401bab 100644 --- a/yuthon_salary/security/ir.model.access.csv +++ b/yuthon_salary/security/ir.model.access.csv @@ -10,4 +10,6 @@ access_yuthon_account_group,access_yuthon_account_group,model_yuthon_account_gro access_salary_payslip_wizard,access_salary_payslip_wizard,model_salary_payslip_wizard,base.group_user,1,1,1,1 access_select_delete_wizard,access_select_delete_wizard,model_select_delete_wizard,base.group_user,1,1,1,1 access_put_wizard,access_put_wizard,model_put_wizard,base.group_user,1,1,1,1 -access_return_wizard,access_return_wizard,model_return_wizard,base.group_user,1,1,1,1 \ No newline at end of file +access_return_wizard,access_return_wizard,model_return_wizard,base.group_user,1,1,1,1 +access_return_salary_wizard, access_return_salary_wizard,model_return_salary_wizard,base.group_user,1,1,1,1 +access_put_salary_wizard,access_put_salary_wizard,model_put_salary_wizard,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/yuthon_salary/views/inherit_hr_payslip_views.xml b/yuthon_salary/views/inherit_hr_payslip_views.xml index a3bf8cd2b..e5ca6deed 100644 --- a/yuthon_salary/views/inherit_hr_payslip_views.xml +++ b/yuthon_salary/views/inherit_hr_payslip_views.xml @@ -3,11 +3,8 @@ hr.payroll.inherit hr.payslip - + - - custom_salary_button - 1 @@ -38,15 +35,16 @@ - +