perf: cache pricing rule query

This commit is contained in:
Ankush Menat
2025-06-04 17:07:33 +05:30
parent 4dc2969fa6
commit a36daec939

View File

@@ -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"]: