mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-24 09:08:30 +00:00
fix: resolve sql syntax on accounting dimension
(cherry picked from commit 1662b7c311)
This commit is contained in:
@@ -86,7 +86,7 @@ def set_gl_entries_by_account(dimension_list, filters, account, gl_entries_by_ac
|
|||||||
"finance_book": cstr(filters.get("finance_book")),
|
"finance_book": cstr(filters.get("finance_book")),
|
||||||
}
|
}
|
||||||
|
|
||||||
gl_filters["dimensions"] = set(dimension_list)
|
gl_filters["dimensions"] = tuple(set(dimension_list))
|
||||||
|
|
||||||
if filters.get("include_default_book_entries"):
|
if filters.get("include_default_book_entries"):
|
||||||
gl_filters["company_fb"] = frappe.get_cached_value("Company", filters.company, "default_finance_book")
|
gl_filters["company_fb"] = frappe.get_cached_value("Company", filters.company, "default_finance_book")
|
||||||
@@ -179,7 +179,7 @@ def accumulate_values_into_parents(accounts, accounts_by_name, dimension_list):
|
|||||||
def get_condition(dimension):
|
def get_condition(dimension):
|
||||||
conditions = []
|
conditions = []
|
||||||
|
|
||||||
conditions.append(f"{frappe.scrub(dimension)} in (%(dimensions)s)")
|
conditions.append(f"{frappe.scrub(dimension)} in %(dimensions)s")
|
||||||
|
|
||||||
return " and {}".format(" and ".join(conditions)) if conditions else ""
|
return " and {}".format(" and ".join(conditions)) if conditions else ""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user