From c05c2cc03cfa45fccfab420908bf7dc0726a4b87 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 17 Jan 2018 11:48:24 +0100 Subject: [PATCH] [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 --- addons/hr_payroll/models/hr_payroll.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/hr_payroll/models/hr_payroll.py b/addons/hr_payroll/models/hr_payroll.py index becb958c771..09719395543 100644 --- a/addons/hr_payroll/models/hr_payroll.py +++ b/addons/hr_payroll/models/hr_payroll.py @@ -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)