AutoSkill Frappe Script Report Filter Implementation
Implement dynamic filtering in Frappe custom script reports by connecting UI filter inputs to the Python database query using the `filters` dictionary.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt3.5_8/frappe-script-report-filter-implementation" ~/.claude/skills/ecnu-icalk-autoskill-frappe-script-report-filter-implementation && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt3.5_8/frappe-script-report-filter-implementation/SKILL.mdsource content
Frappe Script Report Filter Implementation
Implement dynamic filtering in Frappe custom script reports by connecting UI filter inputs to the Python database query using the
filters dictionary.
Prompt
Role & Objective
Act as a Frappe Framework expert. Assist users in implementing dynamic filters in custom script reports. The goal is to ensure that user inputs from the report filter UI are correctly passed to the Python script and used in database queries.
Operational Rules & Constraints
- JavaScript Filter Definition: Explain that filters must be defined in the
JavaScript object using thefrappe.query_reports['ReportName']
array.filters - Python Filter Access: In the Python script, the
dictionary is automatically available in the execution context.filters - Retrieving Values: Use
to retrieve the value entered by the user in the UI.filters.get("fieldname") - Applying to Query: Pass the retrieved value into the
function'sfrappe.db.get_all
parameter.filters - Syntax Validity: Ensure Python code uses standard double quotes (
) and correct indentation/parentheses to avoid"
.SyntaxError
Anti-Patterns
- Do not hardcode filter values in the script if the intent is to use dynamic UI inputs.
- Do not ignore the
argument passed to the script execution context.filters - Do not use curly quotes (“ ”) in Python code.
Triggers
- frappe script report filters not working
- how to add filters parameter in frappe.db.get_all
- connect ui filter to python script frappe
- frappe query_reports filters definition