diff --git a/erpnext/patches/v11_1/move_customer_lead_to_dynamic_column.py b/erpnext/patches/v11_1/move_customer_lead_to_dynamic_column.py index 305a4b01f9d..23e91c7ebc7 100644 --- a/erpnext/patches/v11_1/move_customer_lead_to_dynamic_column.py +++ b/erpnext/patches/v11_1/move_customer_lead_to_dynamic_column.py @@ -6,5 +6,5 @@ import frappe def execute(): - frappe.db.dql(""" UPDATE `tabQuotation` set customer_lead = lead WHERE quotation_to = 'Lead' """) - frappe.db.dql(""" UPDATE `tabQuotation` set customer_lead = customer WHERE quotation_to = 'Customer' """) \ No newline at end of file + frappe.db.sql(""" UPDATE `tabQuotation` set customer_lead = lead WHERE quotation_to = 'Lead' """) + frappe.db.sql(""" UPDATE `tabQuotation` set customer_lead = customer WHERE quotation_to = 'Customer' """) \ No newline at end of file diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index 195101ed6b4..cf8788963cc 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -22,11 +22,11 @@ frappe.ui.form.on('Quotation', { refresh: function(frm) { frm.trigger("set_label"); + frm.trigger("set_dynamic_field_label"); }, quotation_to: function(frm) { frm.trigger("set_label"); - frm.trigger("set_dynamic_field_label"); frm.trigger("toggle_reqd_lead_customer"); }, diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json index 83de49e2ab5..87a8aab3cfc 100644 --- a/erpnext/selling/doctype/quotation/quotation.json +++ b/erpnext/selling/doctype/quotation/quotation.json @@ -170,7 +170,7 @@ "in_global_search": 1, "in_list_view": 0, "in_standard_filter": 1, - "label": "", + "label": "Customer/Lead", "length": 0, "no_copy": 0, "oldfieldname": "customer", @@ -3224,7 +3224,7 @@ "istable": 0, "max_attachments": 1, "menu_index": 0, - "modified": "2019-04-02 10:06:27.850280", + "modified": "2019-04-02 10:18:58.506125", "modified_by": "Administrator", "module": "Selling", "name": "Quotation", diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 2a04ca68126..c1529bb322b 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -43,7 +43,7 @@ class Quotation(SellingController): super(Quotation, self).validate_order_type() def update_lead(self): - if self.quotation_to == "Lead": + if self.quotation_to == "Lead" and self.customer_lead: frappe.get_doc("Lead", self.customer_lead).set_status(update=True) def update_opportunity(self):