diff --git a/yuthon_salary/wizard/select_delete_wizard.py b/yuthon_salary/wizard/select_delete_wizard.py index 09f56fb04..b7b682ab5 100644 --- a/yuthon_salary/wizard/select_delete_wizard.py +++ b/yuthon_salary/wizard/select_delete_wizard.py @@ -17,6 +17,9 @@ class SelectDeleteWizard(models.Model): def confirm(self): for record in self: if record.name: + payslip_lines = self.env['hr.payslip.line'].search([('name', '=', record.name)]) + payslip_lines.sudo().unlink() + structure_ids = self.env['hr.payroll.structure'].search([]) for structure in structure_ids: for rule in structure.rule_ids: