diff --git a/yuthon_salary/models/inherit_hr_payslip.py b/yuthon_salary/models/inherit_hr_payslip.py index 4c26e8f20..bd4280b8a 100644 --- a/yuthon_salary/models/inherit_hr_payslip.py +++ b/yuthon_salary/models/inherit_hr_payslip.py @@ -254,10 +254,6 @@ class InheritHrPayslip(models.Model): for record in self: record.write({'is_salary_push': True}) - def return_salary_button(self): - for record in self: - record.write({'is_salary_release': False}) - def action_put_wizard(self): return { "type": "ir.actions.act_window", @@ -313,7 +309,8 @@ class InheritHrPayslip(models.Model): def put_release(self): for record in self: record.write({ - 'is_salary_release': True + 'is_salary_release': True, + 'salary_state': 'to_release', }) def all_put_release(self): @@ -324,6 +321,12 @@ class InheritHrPayslip(models.Model): 'salary_state': 'to_release', }) + def return_salary_button(self): + for record in self: + record.write({'is_salary_release': False, + 'salary_state': 'to_signed'}) + + def all_return_release(self): payslip_ids = self.env["hr.payslip"].browse(self._context.get('active_ids', self._context.get('active_id'))) for record in payslip_ids: