From a36daec9399a63e460e347285df712ec445f6674 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 4 Jun 2025 17:07:33 +0530 Subject: [PATCH] perf: cache pricing rule query --- erpnext/accounts/doctype/pricing_rule/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/pricing_rule/utils.py b/erpnext/accounts/doctype/pricing_rule/utils.py index e4a85b86b83..ff1ccfd352a 100644 --- a/erpnext/accounts/doctype/pricing_rule/utils.py +++ b/erpnext/accounts/doctype/pricing_rule/utils.py @@ -28,7 +28,7 @@ def get_pricing_rules(args, doc=None): pricing_rules = [] values = {} - if not frappe.db.exists("Pricing Rule", {"disable": 0, args.transaction_type: 1}): + if not frappe.db.count("Pricing Rule", cache=True): return for apply_on in ["Item Code", "Item Group", "Brand"]: