[FIX] hr_payroll: Compute all payslips when closing batch

Closing a Payslip Batch has to ensure that all payslips inside of it
are well calculated and closed. Otherwise some helpers (as `sum`) won't
work correctly because there are open payslips from the last month batch.

This action ensures that if there's a Payslip Batch with 200+ employees,
closing the Batch will complete the whole process including the accounting.

closes odoo/odoo#25755
This commit is contained in:
Gustavo Valverde
2018-11-13 17:33:23 +00:00
committed by Yannick Tivisse
parent bf03b4ba93
commit b8c5637e7e
+1
View File
@@ -506,4 +506,5 @@ class HrPayslipRun(models.Model):
@api.multi
def close_payslip_run(self):
self.mapped('slip_ids').filtered(lambda payslip: payslip.state != 'done').action_payslip_done()
return self.write({'state': 'close'})