mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-30 12:08:26 +00:00
fix: Dynamic link fixes in quotation and opportunity
This commit is contained in:
@@ -20,6 +20,13 @@ frappe.ui.form.on("Opportunity", {
|
||||
});
|
||||
},
|
||||
|
||||
customer_lead: function(frm) {
|
||||
if (frm.doc.opportunity_from == "Customer") {
|
||||
frm.trigger('set_contact_link');
|
||||
erpnext.utils.get_party_details(frm);
|
||||
}
|
||||
},
|
||||
|
||||
with_items: function(frm) {
|
||||
frm.trigger('toggle_mandatory');
|
||||
},
|
||||
@@ -73,6 +80,14 @@ frappe.ui.form.on("Opportunity", {
|
||||
}
|
||||
},
|
||||
|
||||
set_contact_link: function(frm) {
|
||||
if(frm.doc.opportunity_from == "Customer" && frm.doc.customer_lead) {
|
||||
frappe.dynamic_link = {doc: frm.doc, fieldname: 'customer', doctype: 'Customer'}
|
||||
} else if(frm.doc.opportunity_from == "Lead" && frm.doc.customer_lead) {
|
||||
frappe.dynamic_link = {doc: frm.doc, fieldname: 'lead', doctype: 'Lead'}
|
||||
}
|
||||
},
|
||||
|
||||
set_dynamic_field_label: function(frm){
|
||||
if (frm.doc.opportunity_from == "Customer")
|
||||
{
|
||||
|
||||
@@ -44,6 +44,8 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
|
||||
},
|
||||
refresh: function(doc, dt, dn) {
|
||||
this._super(doc, dt, dn);
|
||||
doctype = doc.quotation_to == 'Customer' ? 'Customer':'Lead';
|
||||
frappe.dynamic_link = {doc: this.frm.doc, fieldname: doctype.toLowerCase(), doctype: doctype}
|
||||
|
||||
var me = this;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user