mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-14 12:25:09 +00:00
fix: add group by after user permission condition
(cherry picked from commit 756d496235)
This commit is contained in:
@@ -519,9 +519,6 @@ def get_accounting_entries(
|
|||||||
.where(gl_entry.company == filters.company)
|
.where(gl_entry.company == filters.company)
|
||||||
)
|
)
|
||||||
|
|
||||||
if group_by_account:
|
|
||||||
query = query.groupby(gl_entry.account)
|
|
||||||
|
|
||||||
ignore_is_opening = frappe.db.get_single_value(
|
ignore_is_opening = frappe.db.get_single_value(
|
||||||
"Accounts Settings", "ignore_is_opening_check_for_reporting"
|
"Accounts Settings", "ignore_is_opening_check_for_reporting"
|
||||||
)
|
)
|
||||||
@@ -551,6 +548,9 @@ def get_accounting_entries(
|
|||||||
if match_conditions:
|
if match_conditions:
|
||||||
query += "and" + match_conditions
|
query += "and" + match_conditions
|
||||||
|
|
||||||
|
if group_by_account:
|
||||||
|
query += " GROUP BY `account`"
|
||||||
|
|
||||||
return frappe.db.sql(query, params, as_dict=True)
|
return frappe.db.sql(query, params, as_dict=True)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user