Commit e96645d7 authored by jira's avatar jira
Browse files

[FIX] action_done and action_draft now working

parent bdd5327d
......@@ -21,6 +21,23 @@ class HrPayslipRun(models.Model):
struct_id = fields.Many2one('hr.payroll.structure', name='Struct')
def draft_payslip_run(self):
slips = self.mapped("slip_ids")
slips.write({'state': 'draft'})
return super(HrPayslipRun, self).draft_payslip_run()
def close_payslip_run(self):
ctx = dict(self.env.context)
for form in self:
ctx['accounting_date'] = form.accounting_date
for slip in form.slip_ids.with_context(ctx):
return super(HrPayslipRun, self).close_payslip_run()
def _recompute_slip_ids(self):
return self.slip_ids.compute_sheet()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment