refactor: ignore disabled account while selecting Income Accounts

(cherry picked from commit 6e3e094c95)
This commit is contained in:
ruthra kumar
2023-11-02 17:19:06 +05:30
committed by Mergify
parent b3562bdb87
commit ef9e8406eb
2 changed files with 12 additions and 10 deletions

View File

@@ -611,6 +611,8 @@ 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)}"
return frappe.db.sql(
"""select tabAccount.name from `tabAccount`
where (tabAccount.report_type = "Profit and Loss"