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.
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.