Hi ,
I am preparing a custom script report , I did exactly as per https://frappe.github.io/frappe/user/en/guides/reports-and-printing/how-to-make-script-reports.html and made a standard report in my custom app and templates for js and py file were created automatically inside my custom app folder .This app will contain products manufactured and its details now i want to create a report filtering the products customer wise , I set the filter in js file ( i.e) Customer. Custom app name : Material Master custom doctype name : Material master . Now i want to filter the products so can anyone help me with the py script , i want to return two fields which I have written , please help me with the script to filter the data customer wise , below is my script
js file
frappe.query_reports[“product_filter”] = {
“filters”: [
{
“fieldname”:“customer”,
“label”: __(“Customer”),
“fieldtype”: “Link”,
“options”: “Customer”,
“default”: frappe.defaults.get_user_default(“Customer”)
}
]
}
and py file
from future import unicode_literals
import frappe, json
return [{
"fieldname": "part_number",
"label": "part number",
"width": 200,
"fieldtype": "Data",
},
{
"fieldname": "part_name",
"label": "part name",
"width": 200,
"fieldtype": "Data"
}], data
Atleast please someone give me a syntax to filter the data .