perf: Cached accounting dimensions details
This commit is contained in:
@@ -236,14 +236,15 @@ def get_accounting_dimensions(as_list=True, filters=None):
|
|||||||
|
|
||||||
|
|
||||||
def get_checks_for_pl_and_bs_accounts():
|
def get_checks_for_pl_and_bs_accounts():
|
||||||
dimensions = frappe.db.sql(
|
if frappe.flags.accounting_dimensions_details is None:
|
||||||
"""SELECT p.label, p.disabled, p.fieldname, c.default_dimension, c.company, c.mandatory_for_pl, c.mandatory_for_bs
|
frappe.flags.accounting_dimensions_details = frappe.db.sql(
|
||||||
FROM `tabAccounting Dimension`p ,`tabAccounting Dimension Detail` c
|
"""SELECT p.label, p.disabled, p.fieldname, c.default_dimension, c.company, c.mandatory_for_pl, c.mandatory_for_bs
|
||||||
WHERE p.name = c.parent""",
|
FROM `tabAccounting Dimension`p ,`tabAccounting Dimension Detail` c
|
||||||
as_dict=1,
|
WHERE p.name = c.parent""",
|
||||||
)
|
as_dict=1,
|
||||||
|
)
|
||||||
|
|
||||||
return dimensions
|
return frappe.flags.accounting_dimensions_details
|
||||||
|
|
||||||
|
|
||||||
def get_dimension_with_children(doctype, dimensions):
|
def get_dimension_with_children(doctype, dimensions):
|
||||||
|
|||||||
Reference in New Issue
Block a user