fix: Unable to add details in quotation and opportunity (#19354)

diff --git a/erpnext/crm/doctype/lead/lead.py b/erpnext/crm/doctype/lead/lead.py
index c9216ee..1dae4b9 100644
--- a/erpnext/crm/doctype/lead/lead.py
+++ b/erpnext/crm/doctype/lead/lead.py
@@ -146,14 +146,7 @@
 @frappe.whitelist()
 def make_opportunity(source_name, target_doc=None):
 	def set_missing_values(source, target):
-		address = frappe.get_all('Dynamic Link', {
-			'link_doctype': source.doctype,
-			'link_name': source.name,
-			'parenttype': 'Address',
-		}, ['parent'], limit=1)
-
-		if address:
-			target.customer_address = address[0].parent
+		_set_missing_values(source, target)
 
 	target_doc = get_mapped_doc("Lead", source_name,
 		{"Lead": {
@@ -173,13 +166,17 @@
 
 @frappe.whitelist()
 def make_quotation(source_name, target_doc=None):
+	def set_missing_values(source, target):
+		_set_missing_values(source, target)
+
 	target_doc = get_mapped_doc("Lead", source_name,
 		{"Lead": {
 			"doctype": "Quotation",
 			"field_map": {
 				"name": "party_name"
 			}
-		}}, target_doc)
+		}}, target_doc, set_missing_values)
+
 	target_doc.quotation_to = "Lead"
 	target_doc.run_method("set_missing_values")
 	target_doc.run_method("set_other_charges")
@@ -187,6 +184,25 @@
 
 	return target_doc
 
+def _set_missing_values(source, target):
+	address = frappe.get_all('Dynamic Link', {
+			'link_doctype': source.doctype,
+			'link_name': source.name,
+			'parenttype': 'Address',
+		}, ['parent'], limit=1)
+
+	contact = frappe.get_all('Dynamic Link', {
+			'link_doctype': source.doctype,
+			'link_name': source.name,
+			'parenttype': 'Contact',
+		}, ['parent'], limit=1)
+
+	if address:
+		target.customer_address = address[0].parent
+
+	if contact:
+		target.contact_person = contact[0].parent
+
 @frappe.whitelist()
 def get_lead_details(lead, posting_date=None, company=None):
 	if not lead: return {}
diff --git a/erpnext/crm/doctype/opportunity/opportunity.js b/erpnext/crm/doctype/opportunity/opportunity.js
index 6e4d3ed..c9b0433 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.js
+++ b/erpnext/crm/doctype/opportunity/opportunity.js
@@ -100,10 +100,6 @@
 				});
 			}
 		}
-
-		if (frm.doc.opportunity_from && frm.doc.party_name && !frm.doc.contact_person) {
-			frm.trigger("party_name");
-		}
 	},
 
 	set_contact_link: function(frm) {
@@ -171,7 +167,7 @@
 		if (me.frm.doc.opportunity_from == "Lead") {
 			me.frm.set_query('party_name', erpnext.queries['lead']);
 		}
-		else if (me.frm.doc.opportunity_from == "Cuatomer") {
+		else if (me.frm.doc.opportunity_from == "Customer") {
 			me.frm.set_query('party_name', erpnext.queries['customer']);
 		}
 	},
diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js
index fb5336b..12f3260 100644
--- a/erpnext/selling/doctype/quotation/quotation.js
+++ b/erpnext/selling/doctype/quotation/quotation.js
@@ -23,9 +23,6 @@
 	refresh: function(frm) {
 		frm.trigger("set_label");
 		frm.trigger("set_dynamic_field_label");
-		if (frm.doc.quotation_to && frm.doc.party_name && !frm.doc.contact_person) {
-			frm.trigger("party_name");
-		}
 	},
 
 	quotation_to: function(frm) {