File tree Expand file tree Collapse file tree
selling/doctype/quotation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,13 @@ frappe.ui.form.on("Opportunity", {
2020 } ) ;
2121 } ,
2222
23+ customer_lead : function ( frm ) {
24+ if ( frm . doc . opportunity_from == "Customer" ) {
25+ frm . trigger ( 'set_contact_link' ) ;
26+ erpnext . utils . get_party_details ( frm ) ;
27+ }
28+ } ,
29+
2330 with_items : function ( frm ) {
2431 frm . trigger ( 'toggle_mandatory' ) ;
2532 } ,
@@ -73,6 +80,14 @@ frappe.ui.form.on("Opportunity", {
7380 }
7481 } ,
7582
83+ set_contact_link : function ( frm ) {
84+ if ( frm . doc . opportunity_from == "Customer" && frm . doc . customer_lead ) {
85+ frappe . dynamic_link = { doc : frm . doc , fieldname : 'customer' , doctype : 'Customer' }
86+ } else if ( frm . doc . opportunity_from == "Lead" && frm . doc . customer_lead ) {
87+ frappe . dynamic_link = { doc : frm . doc , fieldname : 'lead' , doctype : 'Lead' }
88+ }
89+ } ,
90+
7691 set_dynamic_field_label : function ( frm ) {
7792 if ( frm . doc . opportunity_from == "Customer" )
7893 {
Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
4444 } ,
4545 refresh : function ( doc , dt , dn ) {
4646 this . _super ( doc , dt , dn ) ;
47+ doctype = doc . quotation_to == 'Customer' ? 'Customer' :'Lead' ;
48+ frappe . dynamic_link = { doc : this . frm . doc , fieldname : doctype . toLowerCase ( ) , doctype : doctype }
4749
4850 var me = this ;
4951
You can’t perform that action at this time.
0 commit comments