From 013011aa43dec308dccd95c111c66f294ae61dfb Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 4 Jun 2025 15:44:57 +0530 Subject: [PATCH] perf: cache existence of budgets while validating GL --- erpnext/accounts/doctype/budget/budget.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/budget/budget.py b/erpnext/accounts/doctype/budget/budget.py index 6fe4e8edcf7..11fa72c3c2f 100644 --- a/erpnext/accounts/doctype/budget/budget.py +++ b/erpnext/accounts/doctype/budget/budget.py @@ -145,7 +145,7 @@ class Budget(Document): def validate_expense_against_budget(args, expense_amount=0): args = frappe._dict(args) - if not frappe.get_all("Budget", limit=1): + if not frappe.db.count("Budget", cache=True): return if args.get("company") and not args.fiscal_year: