mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-17 17:26:43 +00:00
perf: validate expense against budget only if budget exists
This commit is contained in:
@@ -118,6 +118,11 @@ def validate_expense_against_budget(args, expense_amount=0):
|
|||||||
"Company", args.get("company"), "exception_budget_approver_role"
|
"Company", args.get("company"), "exception_budget_approver_role"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not frappe.get_cached_value(
|
||||||
|
"Budget", {"fiscal_year": args.fiscal_year, "company": args.company}
|
||||||
|
): # nosec
|
||||||
|
return
|
||||||
|
|
||||||
if not args.account:
|
if not args.account:
|
||||||
args.account = args.get("expense_account")
|
args.account = args.get("expense_account")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user