perf: use get_cached_value instead of db.get_value in controllers (#32776)

This commit is contained in:
Daizy Modi
2022-11-07 09:21:03 +05:30
committed by GitHub
parent 8859e6f1bb
commit 4efc947f14
5 changed files with 29 additions and 25 deletions

View File

@@ -1056,7 +1056,7 @@ class init_landed_taxes_and_totals(object):
company_currency = erpnext.get_company_currency(self.doc.company)
for d in self.doc.get(self.tax_field):
if not d.account_currency:
account_currency = frappe.db.get_value("Account", d.expense_account, "account_currency")
account_currency = frappe.get_cached_value("Account", d.expense_account, "account_currency")
d.account_currency = account_currency or company_currency
def set_exchange_rate(self):