fix: Check for paid field

This commit is contained in:
Deepesh Garg 2020-12-12 19:31:05 +05:30
parent 68fce6d029
commit ced3b13492

View File

@ -23,8 +23,10 @@ def execute():
frappe.reload_doc('accounts', 'doctype', 'journal_entry_account') frappe.reload_doc('accounts', 'doctype', 'journal_entry_account')
updated_loan_types = [] updated_loan_types = []
loans_to_close = []
# Update old loan status as closed # Update old loan status as closed
if frappe.db.has_column('Repayment Schedule', 'paid'):
loans_list = frappe.db.sql("""SELECT distinct parent from `tabRepayment Schedule` loans_list = frappe.db.sql("""SELECT distinct parent from `tabRepayment Schedule`
where paid = 0 and docstatus = 1""", as_dict=1) where paid = 0 and docstatus = 1""", as_dict=1)