perf: Use client cached configuration (#47838)

These are accessed on every document load, reaching to DB is excessive.
This commit is contained in:
Ankush Menat
2025-06-02 11:44:51 +05:30
committed by GitHub
parent 705b9e0181
commit f86c3f7f8b

View File

@@ -118,7 +118,7 @@ class AccountsController(TransactionBase):
def onload(self):
self.set_onload(
"make_payment_via_journal_entry",
frappe.db.get_single_value("Accounts Settings", "make_payment_via_journal_entry"),
frappe.client_cache.get_doc("Accounts Settings").make_payment_via_journal_entry,
)
if self.is_new():