mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-23 21:22:42 +01:00
Merge pull request #47709 from diptanilsaha/patch-custom-gl-report
fix: patch to rename group_by filter in custom reports
This commit is contained in:
@@ -413,3 +413,4 @@ erpnext.patches.v14_0.set_update_price_list_based_on
|
||||
erpnext.patches.v15_0.update_journal_entry_type
|
||||
erpnext.patches.v15_0.set_grand_total_to_default_mop
|
||||
execute:frappe.db.set_single_value("Accounts Settings", "use_new_budget_controller", True)
|
||||
erpnext.patches.v15_0.rename_group_by_to_categorize_by_in_custom_reports
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import json
|
||||
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
custom_reports = frappe.get_all(
|
||||
"Report",
|
||||
filters={
|
||||
"report_type": "Custom Report",
|
||||
"reference_report": ["in", ["General Ledger", "Supplier Quotation Comparison"]],
|
||||
},
|
||||
fields=["name", "json"],
|
||||
)
|
||||
|
||||
for report in custom_reports:
|
||||
report_json = json.loads(report.json)
|
||||
|
||||
if "filters" in report_json and "group_by" in report_json["filters"]:
|
||||
report_json["filters"]["categorize_by"] = (
|
||||
report_json["filters"].pop("group_by").replace("Group", "Categorize")
|
||||
)
|
||||
|
||||
frappe.db.set_value("Report", report.name, "json", json.dumps(report_json))
|
||||
Reference in New Issue
Block a user