Need help with custom script report

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 .

Please someone help me with the script .

@ragav some tips to you!

The principle of community is that all will work in benefit of all! If you need the things ASAP, buy the support from someone or from the main team! If you can’t do this! Start learning, and understanding how the things works! And remeber that : “If something is free, is because someone is paying for it!”, learn how to be patient! And learn how to help someone, before of think that you will find someone to do your work for you!

2 Likes