diff --git a/yuthon_salary/models/inherit_hr_payslip.py b/yuthon_salary/models/inherit_hr_payslip.py index 3e5f0b250..bc2eab22a 100644 --- a/yuthon_salary/models/inherit_hr_payslip.py +++ b/yuthon_salary/models/inherit_hr_payslip.py @@ -20,7 +20,7 @@ class InheritHrPayslip(models.Model): three_one = fields.Float(string='三险一金', store=True, compute='_compute_salary') identification_id = fields.Char(string='证件号码', related='employee_id.identification_id', store=True) card_type = fields.Char(string='证件类型', store=True, default="居民身份证") - salary_group_id = fields.Many2one(related='employee_id.salary_group_id', string="工资组", store=True, index=True) + salary_group_id = fields.Many2one('yuthon.salary.group', 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) @@ -115,7 +115,7 @@ class InheritHrPayslip(models.Model): # 粮储常用项 quality_allowance = fields.Float(string='质检员津贴') environmental_allowance = fields.Float(string='环境作业津贴') - + performance_deduction = fields.Float(string='扣发绩效奖金', compute='_compute_deduction', store=True) commuting_deduction = fields.Float(string='扣发通信补贴', compute='_compute_deduction', store=True) base_salary_deduction = fields.Float(string='扣发基本工资', compute='_compute_deduction', store=True) @@ -407,4 +407,12 @@ class InheritHrPayslip(models.Model): "res_id": self.id, "name": "薪资详情", "view_mode": "form", - } \ No newline at end of file + } + + def update(self): + payslip_ids = self.env["hr.payslip"].browse( + self._context.get('active_ids', self._context.get('active_id'))) + for record in payslip_ids: + record.write({ + 'salary_group_id': record.employee_id.contract_id.salary_group_id.id, + }) \ No newline at end of file diff --git a/yuthon_salary/security/salary_security_rule.xml b/yuthon_salary/security/salary_security_rule.xml index 47c38ffb0..a7e8ad39b 100644 --- a/yuthon_salary/security/salary_security_rule.xml +++ b/yuthon_salary/security/salary_security_rule.xml @@ -65,4 +65,13 @@ 粮储公司用户 + + + 粮储公司用户 + + + + 工资批次确认 + + \ No newline at end of file diff --git a/yuthon_salary/views/inherit_hr_payslip_run_views.xml b/yuthon_salary/views/inherit_hr_payslip_run_views.xml index 0fa6a444b..84e4d141d 100644 --- a/yuthon_salary/views/inherit_hr_payslip_run_views.xml +++ b/yuthon_salary/views/inherit_hr_payslip_run_views.xml @@ -15,7 +15,7 @@