Skip to content

Commit

Permalink
fix: User permissions in financial statements
Browse files Browse the repository at this point in the history
(cherry picked from commit a626372)
  • Loading branch information
ljain112 authored and mergify[bot] committed Dec 17, 2024
1 parent 2b27892 commit 83aeb2e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion erpnext/accounts/report/financial_statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,16 @@ def get_accounting_entries(
account_filter_query = get_account_filter_query(root_lft, root_rgt, root_type, gl_entry)
query = query.where(ExistsCriterion(account_filter_query))

entries = query.run(as_dict=True)
query = query.get_sql()

from frappe.desk.reportview import build_match_conditions

match_conditions = build_match_conditions(doctype)

if match_conditions:
query += "and" + match_conditions

entries = frappe.db.sql(query, as_dict=True)

return entries

Expand Down

0 comments on commit 83aeb2e

Please sign in to comment.