From c9f79b3ba97c57ecbc119b42e4b07c98aacdf5ad Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Fri, 15 Aug 2025 22:22:55 +0530 Subject: [PATCH] fix: formatted string for disabled filter in get_income_account (cherry picked from commit 6320f7290f93a5278ffdfaa790af70427c20a1c8) --- erpnext/controllers/queries.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 17141751ca1..548109394de 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -615,7 +615,7 @@ def get_income_account(doctype, txt, searchfield, start, page_len, filters): if filters.get("company"): condition += "and tabAccount.company = %(company)s" - condition += f"and tabAccount.disabled = {filters.get('disabled', 0)}" + condition += " and tabAccount.disabled = %(disabled)s" return frappe.db.sql( f"""select tabAccount.name from `tabAccount` @@ -625,7 +625,11 @@ def get_income_account(doctype, txt, searchfield, start, page_len, filters): and tabAccount.`{searchfield}` LIKE %(txt)s {condition} {get_match_cond(doctype)} order by idx desc, name""", - {"txt": "%" + txt + "%", "company": filters.get("company", "")}, + { + "txt": "%" + txt + "%", + "company": filters.get("company", ""), + "disabled": cint(filters.get("disabled", 0)), + }, )