frappe / hrms

Open Source HR and Payroll Software
https://frappehr.com
GNU General Public License v3.0
984 stars 551 forks source link

fix: TypeError in Salary Slip Creation Due to Uninitialized Loans Field #1909

Closed KhaledBinAmir closed 6 days ago

KhaledBinAmir commented 1 week ago

After migrating to ERPNext v15, creating payroll entries and individual salary slips failed with a TypeError: 'NoneType' object is not iterable. This issue occurs in the set_loan_repayment function when checking for loans associated with salary slips.

Fix: Added a check to initialize the "loans" field as an empty list if it is None.

This fix ensures that the "loans" field is always iterable, preventing the TypeError and allowing salary slips to be created successfully.