Filtering projects for the specific customer in Opportunity

Hi guys.

I created a link custom field in Opportunity for the projects and i only want to filter a project name which having the same customer.

Example the customer in Opportunity is AL ADRAK CONTRACTING CO LLC any project who has the same customer in customer details will be filtered in opportunity module project field.

Upon checking everything, i created a custom field doctype and make a client script

frappe.ui.form.on(‘Opportunity’, {
party_name: function(frm) {
if (frm.doc.opportunity_from == “Customer”){
frm.set_query(“projects”,function(){
return {
filters: {
“project_from”: “Customer”,
“party_name”: frm.doc.party_name
}
}
})
}
}
})