[FIX] hr_payroll: Unable to refund payslip

The function action_payslip_done has been overwritten in module hr_payroll_account.
Due to this overwrite, the function compute_sheet which creates the payslip lines
was called after the creation of the entries.

Then creating a refund payslip didn't create any entries.

opw:785033
This commit is contained in:
Goffin Simon
2018-01-17 13:11:41 +01:00
parent ef8cd11a6b
commit c05c2cc03c
+1
View File
@@ -244,6 +244,7 @@ class HrPayslip(models.Model):
def refund_sheet(self):
for payslip in self:
copied_payslip = payslip.copy({'credit_note': True, 'name': _('Refund: ') + payslip.name})
copied_payslip.compute_sheet()
copied_payslip.action_payslip_done()
formview_ref = self.env.ref('hr_payroll.view_hr_payslip_form', False)
treeview_ref = self.env.ref('hr_payroll.view_hr_payslip_tree', False)