Merge pull request #30689 from deepeshgarg007/disabled_gl_dimensions

fix: Do not show disabled dimensions in reports
This commit is contained in:
Deepesh Garg 2022-04-12 16:11:07 +05:30 committed by GitHub
commit 228195ba74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -205,10 +205,16 @@ def get_doctypes_with_dimensions():
return frappe.get_hooks("accounting_dimension_doctypes") return frappe.get_hooks("accounting_dimension_doctypes")
def get_accounting_dimensions(as_list=True): def get_accounting_dimensions(as_list=True, filters=None):
if not filters:
filters = {"disabled": 0}
if frappe.flags.accounting_dimensions is None: if frappe.flags.accounting_dimensions is None:
frappe.flags.accounting_dimensions = frappe.get_all( frappe.flags.accounting_dimensions = frappe.get_all(
"Accounting Dimension", fields=["label", "fieldname", "disabled", "document_type"] "Accounting Dimension",
fields=["label", "fieldname", "disabled", "document_type"],
filters=filters,
) )
if as_list: if as_list: