Skip to content

Commit

Permalink
Merge pull request #44695 from ljain112/fix-fin-stat
Browse files Browse the repository at this point in the history
fix: User permissions in financial statements
  • Loading branch information
ruthra-kumar authored Dec 17, 2024
2 parents 7ac7a40 + 5ea131c commit 5c9e8fb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions erpnext/accounts/report/financial_statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +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)
from frappe.desk.reportview import build_match_conditions

return entries
match_conditions = build_match_conditions(doctype)

if match_conditions:
query += "and" + match_conditions

query, params = query.walk()

return frappe.db.sql(query, params, as_dict=True)


def get_account_filter_query(root_lft, root_rgt, root_type, gl_entry):
Expand Down

0 comments on commit 5c9e8fb

Please sign in to comment.