frappe-report-builder
Create and configure Frappe Reports, including Report Builder (UI-based), Query Reports (SQL), and Script Reports (Python).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create and configure Frappe Reports, including Report Builder (UI-based), Query Reports (SQL), and Script Reports (Python).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when configuring hooks.py — doc_events, scheduler_events, override_whitelisted_methods, override_doctype_class, jinja, boot_session, permission_query_conditions, has_permission, and fixtures. Prevents silent hook failures from wrong paths or missing migrate after scheduler changes. Covers full hooks.py reference beyond document lifecycle events. Keywords: hooks.py, doc_events, scheduler_events, override method, permission query conditions, boot session, fixtures, override_doctype_class, extend_doctype_class.
Use when building or consuming Frappe REST APIs — auto /api/resource CRUD, @frappe.whitelist endpoints, token vs session auth, file uploads, and response handling. Prevents unauthorized exposure from missing permission checks on whitelisted methods. Covers /api/resource, /api/method, token auth, OAuth, file upload, error mapping. Keywords: whitelist API, /api/resource, /api/method, Frappe REST, token auth, api_key api_secret, call Frappe from outside, expand, filters.
Use when reading or writing Frappe data safely — get_doc, get_all, get_list, frappe.db.get_value, parameterized frappe.db.sql, transactions, bulk ops, and performance. Prevents SQL injection and permission leaks from wrong API choice. Covers ORM reads/writes, raw SQL, transactions, bulk_update, N+1 avoidance. Keywords: frappe.db.sql, frappe.get_all, get_value, set_value, bulk update, N+1, db transaction, get_list, SQL injection, parameterized query.
Use when implementing Frappe's permission model — roles, perm levels, user permissions, share, permission_query_conditions, has_permission hooks, and in-code checks. Prevents unauthorized access from missing server-side checks or broken row-level filters. Covers role permissions, field-level perm_level, User Permissions, share, hooks, frappe.has_permission. Keywords: permissions, role, user permission, perm level, restrict rows, frappe.has_permission, field level security, permission query conditions, share, PermissionError.
Use when debugging Frappe errors, using bench console for live inspection, analyzing tracebacks, or reading Frappe log files. Prevents wasted debugging time from ignoring log context, misreading tracebacks, and not using bench console effectively. Covers bench console, frappe.logger, error log DocType, traceback analysis, common error patterns, log file locations, pdb/debugger integration, VS Code DAP, profiling, Frappe Recorder, mariadb diagnostics. Keywords: debug, bench console, traceback, error log, frappe.logger, pdb, debugging, log analysis, inspect, VS Code, DAP, profiling, recorder, mariadb, monitor, ERPNext error, how to debug, find the bug, what went wrong, stack trace, error message..
Use when receiving vague or unclear ERPNext/Frappe development requests that need interpretation. Transforms requirements like 'make invoice auto-calculate' or 'add approval workflow' into concrete technical specifications. Determines which Frappe mechanisms to use and maps to the full 61-skill catalog. Keywords: vague requirement, clarify scope, translate business need, technical spec, implementation plan, what does this mean, unclear requirement, translate to code, how to build this.
| name | frappe-report-builder |
| description | Create and configure Frappe Reports, including Report Builder (UI-based), Query Reports (SQL), and Script Reports (Python). |
Frappe supports multiple types of reports to present data effectively.
Standard reports are stored in the database but can be exported to your app.
File Path: [app_name]/[module_name]/report/[report_name]/[report_name].json
Requires a .json definition and an .js file for filters.
File Path: [app_name]/[module_name]/report/[report_name]/[report_name].json
{
"doctype": "Report",
"name": "My Query Report",
"report_type": "Query Report",
"module": "My App",
"is_standard": "Yes",
"query": "SELECT name, creation FROM `tabUser` WHERE status = 'Active'"
}
Requires .json, .py, and .js files.
Python Logic (report_name.py):
import frappe
def execute(filters=None):
columns = get_columns()
data = get_data(filters)
return columns, data
def get_columns():
return [
{"label": "ID", "fieldname": "name", "fieldtype": "Link", "options": "User", "width": 150},
{"label": "Full Name", "fieldname": "full_name", "fieldtype": "Data", "width": 200}
]
def get_data(filters):
return frappe.get_all("User", fields=["name", "full_name"], filters=filters)
JavaScript Filters (report_name.js):
frappe.query_reports["My Script Report"] = {
"filters": [
{
"fieldname": "from_date",
"label": __("From Date"),
"fieldtype": "Date",
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1)
}
]
};
is_standard: "Yes": (Note the string "Yes" instead of 1 in older versions, though 1 is common now). Ensures the report is saved as a file..json, .py, .js) must be in a folder named after the report in the report/ directory of the module.frappe.db.get_all or frappe.qb (Query Builder) for efficient data retrieval._() or __() for translation support.Source: consolidated from frappe-syntax-reports and frappe-impl-reports (Frappe Claude Skill Package). Focus: Report Builder (UI) vs coded reports.
Need a report?
├─ Simple list/group of ONE DocType, no custom code → Report Builder
├─ Direct SQL only, no Python → Query Report
├─ Complex logic, charts, summary cards, formatters → Script Report
│ └─ Very large dataset / timeout risk → Prepared Report
└─ Workspace KPIs → Number Card or Dashboard Chart (separate DocTypes)
| Aspect | Report Builder | Query / Script Report |
|---|---|---|
| Code | None | SQL and/or Python + JS |
| Best for | Ad-hoc tabular views, filters, sort, Group By (Count / Sum / Avg) on one DocType | Joins, custom SQL, Python aggregation, charts, report_summary, custom formatters |
| Typical access | Users who can open the DocType / module | Often stricter (e.g. System Manager / Dev Mode for standard Script Reports) |
| Deployment | Saved in DB; can export standard report JSON to app | Standard reports live under report/<name>/ in the app |
"Label:Fieldtype/Options:Width" column format in SELECT aliases, not the dict column list from Script Reports.execute(), optional chart, report_summary, prepared_report in JS, and client formatter functions — none of that is available inside pure Report Builder configuration.If users outgrow Report Builder (timeouts, huge row counts), move to a Script (or Query) report and enable Prepared Report so generation runs in the background and results are cached for refresh on demand.