Create new contact for Partner in Opportunity but contact have link to customer instead

I’m new to ERPNext. I have add a new contact field in opportunity. That contact field is filtered to the selected Partner as following script:

frappe.ui.form.on(‘Opportunity’, {
setup:function(frm) {
frm.set_query(‘partner_contact_person’, function() {
if (frm.doc.partner) {
return {
query: “”,
filters: { link_doctype: “Sales Partner”, link_name: frm.doc.partner }

But when I create new partner Contact, the link document become the customer instead as following:

Is there a way I can correct the contact link to the selected partner?

Appreciate your help.