[minor] added cache in get_value

This commit is contained in:
Rushabh Mehta
2015-04-27 13:13:38 +05:30
parent 8be3ba36d9
commit 50ce9753e0
4 changed files with 5 additions and 5 deletions

View File

@@ -348,8 +348,8 @@ def get_actual_expense(args):
def get_currency_precision(currency=None):
if not currency:
currency = frappe.db.get_value("Company",
frappe.db.get_default("company"), "default_currency")
currency_format = frappe.db.get_value("Currency", currency, "number_format")
frappe.db.get_default("company"), "default_currency", cache=True)
currency_format = frappe.db.get_value("Currency", currency, "number_format", cache=True)
from frappe.utils import get_number_format_info
return get_number_format_info(currency_format)[2]