mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 04:09:11 +00:00
perf: use get_cached_value instead of db.get_value in accounts module
This commit is contained in:
@@ -174,7 +174,7 @@ def get_gl_entries(filters, accounting_dimensions):
|
||||
order_by_statement = "order by account, posting_date, creation"
|
||||
|
||||
if filters.get("include_default_book_entries"):
|
||||
filters["company_fb"] = frappe.db.get_value(
|
||||
filters["company_fb"] = frappe.get_cached_value(
|
||||
"Company", filters.get("company"), "default_finance_book"
|
||||
)
|
||||
|
||||
@@ -287,7 +287,7 @@ def get_accounts_with_children(accounts):
|
||||
all_accounts = []
|
||||
for d in accounts:
|
||||
if frappe.db.exists("Account", d):
|
||||
lft, rgt = frappe.db.get_value("Account", d, ["lft", "rgt"])
|
||||
lft, rgt = frappe.get_cached_value("Account", d, ["lft", "rgt"])
|
||||
children = frappe.get_all("Account", filters={"lft": [">=", lft], "rgt": ["<=", rgt]})
|
||||
all_accounts += [c.name for c in children]
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user