From 2426810650106e3a772bda1c92b33dc20a82f998 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Fri, 28 Feb 2025 18:50:23 +0530 Subject: [PATCH] fix: reset loans only if field exists (cherry picked from commit 7549d49967d6ea01cc663a19a07c01a4d3dec2e7) --- hrms/payroll/doctype/salary_slip/salary_slip.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hrms/payroll/doctype/salary_slip/salary_slip.py b/hrms/payroll/doctype/salary_slip/salary_slip.py index 16e905f46c..26962822b2 100644 --- a/hrms/payroll/doctype/salary_slip/salary_slip.py +++ b/hrms/payroll/doctype/salary_slip/salary_slip.py @@ -318,9 +318,10 @@ def get_date_details(self): def get_emp_and_working_day_details(self): """First time, load all the components from salary structure""" if self.employee: - self.set("loans", []) self.set("earnings", []) self.set("deductions", []) + if hasattr(self, "loans"): + self.set("loans", []) if self.payroll_frequency: self.get_date_details()