mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 18:59:08 +00:00
perf: Cache accounting dimension filter map
This commit is contained in:
@@ -38,6 +38,7 @@ class AccountingDimensionFilter(Document):
|
||||
|
||||
|
||||
def get_dimension_filter_map():
|
||||
if not frappe.flags.get("dimension_filter_map"):
|
||||
filters = frappe.db.sql(
|
||||
"""
|
||||
SELECT
|
||||
@@ -68,7 +69,9 @@ def get_dimension_filter_map():
|
||||
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):
|
||||
|
||||
Reference in New Issue
Block a user