mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-31 19:02:21 +02:00
fix: backward compatibility for renamed group_by filter on reports (#47362)
* fix: backward compatibility for renamed group_by filter in general ledger report
* fix: backward compatibility for renamed group_by filter in supplier quotation comparison report
(cherry picked from commit d4ffa54136)
Co-authored-by: Diptanil Saha <diptanil@frappe.io>
This commit is contained in:
@@ -63,6 +63,10 @@ def validate_filters(filters, account_details):
|
|||||||
if not account_details.get(account):
|
if not account_details.get(account):
|
||||||
frappe.throw(_("Account {0} does not exists").format(account))
|
frappe.throw(_("Account {0} does not exists").format(account))
|
||||||
|
|
||||||
|
if not filters.get("categorize_by") and filters.get("group_by"):
|
||||||
|
filters["categorize_by"] = filters["group_by"]
|
||||||
|
filters["categorize_by"] = filters["categorize_by"].replace("Group by", "Categorize by")
|
||||||
|
|
||||||
if filters.get("account") and filters.get("categorize_by") == "Categorize by Account":
|
if filters.get("account") and filters.get("categorize_by") == "Categorize by Account":
|
||||||
filters.account = frappe.parse_json(filters.get("account"))
|
filters.account = frappe.parse_json(filters.get("account"))
|
||||||
for account in filters.account:
|
for account in filters.account:
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ def execute(filters=None):
|
|||||||
if not filters:
|
if not filters:
|
||||||
return [], []
|
return [], []
|
||||||
|
|
||||||
|
validate_filters(filters)
|
||||||
|
|
||||||
columns = get_columns(filters)
|
columns = get_columns(filters)
|
||||||
supplier_quotation_data = get_data(filters)
|
supplier_quotation_data = get_data(filters)
|
||||||
|
|
||||||
@@ -24,6 +26,12 @@ def execute(filters=None):
|
|||||||
return columns, data, message, chart_data
|
return columns, data, message, chart_data
|
||||||
|
|
||||||
|
|
||||||
|
def validate_filters(filters):
|
||||||
|
if not filters.get("categorize_by") and filters.get("group_by"):
|
||||||
|
filters["categorize_by"] = filters["group_by"]
|
||||||
|
filters["categorize_by"] = filters["categorize_by"].replace("Group by", "Categorize by")
|
||||||
|
|
||||||
|
|
||||||
def get_data(filters):
|
def get_data(filters):
|
||||||
sq = frappe.qb.DocType("Supplier Quotation")
|
sq = frappe.qb.DocType("Supplier Quotation")
|
||||||
sq_item = frappe.qb.DocType("Supplier Quotation Item")
|
sq_item = frappe.qb.DocType("Supplier Quotation Item")
|
||||||
|
|||||||
Reference in New Issue
Block a user