perf: Cache accounting dimension filter map
This commit is contained in:
@@ -38,6 +38,7 @@ class AccountingDimensionFilter(Document):
|
|||||||
|
|
||||||
|
|
||||||
def get_dimension_filter_map():
|
def get_dimension_filter_map():
|
||||||
|
if not frappe.flags.get("dimension_filter_map"):
|
||||||
filters = frappe.db.sql(
|
filters = frappe.db.sql(
|
||||||
"""
|
"""
|
||||||
SELECT
|
SELECT
|
||||||
@@ -68,7 +69,9 @@ def get_dimension_filter_map():
|
|||||||
f.is_mandatory,
|
f.is_mandatory,
|
||||||
)
|
)
|
||||||
|
|
||||||
return dimension_filter_map
|
frappe.flags.dimension_filter_map = dimension_filter_map
|
||||||
|
|
||||||
|
return frappe.flags.dimension_filter_map
|
||||||
|
|
||||||
|
|
||||||
def build_map(map_object, dimension, account, filter_value, allow_or_restrict, is_mandatory):
|
def build_map(map_object, dimension, account, filter_value, allow_or_restrict, is_mandatory):
|
||||||
|
|||||||
Reference in New Issue
Block a user