Script Report not executing .py logic in ERPNext v15.63 — always loads as Query Report

Hi all,

We’re on ERPNext v15.63 / Frappe v15.69.2 using a custom app (modia_core), and trying to build a standard Script Report.

Despite following all expected steps, the .py logic never runs. ERPNext keeps rendering the report at the /query-report/…route, and shows “Nothing to show” — as if it’s still treating it as a Query Report.


:mag:

Here’s what we’ve confirmed:

  • Report is created via UI with:
    • Report Type = Script Report
    • Is Standard = Yes
    • Module = Modia Core
    • Ref Doctype = Item
  • .py and .json files are named and placed correctly:

modia_core/modia_core/report/modia_sales_stock_view/
├── modia_sales_stock_view.py
└── modia_sales_stock_view.json

•	frappe.msgprint() and even frappe.throw() do not trigger
•	bench reload-doc and clear-cache run cleanly
•	Running frappe.get_doc("Report", "<name>").as_dict() confirms report_type = Script Report
•	No reference_report, query, or custom_report fields exist
•	URL always loads under /query-report/, not /report/

:white_check_mark: What else we’ve tried:
• Renaming report multiple times
• Deleting and recreating from scratch
• Running export-fixtures and reload-doc
• Clearing browser + server cache
• Using Incognito window
• Confirmed file paths match and method is def execute(filters=None):

:question:

What we’re trying to accomplish:

We simply want to display item-level data + custom pricing and inventory logic for salespeople. The script logic works when tested manually — just not through the report UI.


Has anyone run into this? Is there a known bug with Script Report routing or cache in Frappe v15+?

Would love any insights.

Hi,

Please share your .py file to identify the issue.

Thanks,

Divyesh Mangroliya

this is the content of modia_sales_stock_view.py

def execute(filters=None):
columns, data = ,
return columns, data

this is the content of modia_sales_stock_view.json ----

{
“add_total_row”: 1,
“add_translate_data”: 0,
“columns”: ,
“creation”: “2025-06-30 20:17:54.236591”,
“disabled”: 0,
“docstatus”: 0,
“doctype”: “Report”,
“filters”: ,
“idx”: 0,
“is_standard”: “Yes”,
“json”: “{}”,
“letterhead”: null,
“modified”: “2025-06-30 20:27:05.018085”,
“modified_by”: “Administrator”,
“module”: “Modia Core”,
“name”: “MODIA Sales Stock View”,
“owner”: “Administrator”,
“prepared_report”: 0,
“ref_doctype”: “Item”,
“report_name”: “MODIA Sales Stock View”,
“report_type”: “Script Report”,
“roles”: [
{
“role”: “Item Manager”
},
{
“role”: “Stock Manager”
},
{
“role”: “Stock User”
},
{
“role”: “Sales User”
},
{
“role”: “Purchase User”
},
{
“role”: “Maintenance User”
},
{
“role”: “Accounts User”
},
{
“role”: “Manufacturing User”
},
{
“role”: “Desk User”
}
],
“timeout”: 0
}