From a1e3ae8869194a487acccc706a381db74c4aa1ff Mon Sep 17 00:00:00 2001 From: Saqib Ansari Date: Wed, 11 May 2022 13:01:06 +0530 Subject: [PATCH] fix: user can select disabled accounts in taxes table --- erpnext/controllers/queries.py | 2 ++ erpnext/public/js/controllers/accounts.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index abe9977c84..eeb5a7f1a9 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -162,6 +162,7 @@ def tax_account_query(doctype, txt, searchfield, start, page_len, filters): {account_type_condition} AND is_group = 0 AND company = %(company)s + AND disabled = %(disabled)s AND (account_currency = %(currency)s or ifnull(account_currency, '') = '') AND `{searchfield}` LIKE %(txt)s {mcond} @@ -175,6 +176,7 @@ def tax_account_query(doctype, txt, searchfield, start, page_len, filters): dict( account_types=filters.get("account_type"), company=filters.get("company"), + disabled=filters.get("disabled", 0), currency=company_currency, txt="%{}%".format(txt), offset=start, diff --git a/erpnext/public/js/controllers/accounts.js b/erpnext/public/js/controllers/accounts.js index 84c717676c..c1fe72bb48 100644 --- a/erpnext/public/js/controllers/accounts.js +++ b/erpnext/public/js/controllers/accounts.js @@ -27,7 +27,8 @@ frappe.ui.form.on(cur_frm.doctype, { query: "erpnext.controllers.queries.tax_account_query", filters: { "account_type": account_type, - "company": doc.company + "company": doc.company, + "disabled": 0 } } });