diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 9dcb285a0a3..e2929ca2ed9 100755 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -589,4 +589,5 @@ erpnext.patches.v11_0.remove_barcodes_field_from_copy_fields_to_variants erpnext.patches.v10_0.item_barcode_childtable_migrate # 16-02-2019 erpnext.patches.v11_0.make_italian_localization_fields # 26-03-2019 erpnext.patches.v11_1.make_job_card_time_logs -erpnext.patches.v11_1.set_variant_based_on \ No newline at end of file +erpnext.patches.v11_1.set_variant_based_on +erpnext.patches.v11_1.move_customer_lead_to_dynamic_column 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 new file mode 100644 index 00000000000..305a4b01f9d --- /dev/null +++ b/erpnext/patches/v11_1/move_customer_lead_to_dynamic_column.py @@ -0,0 +1,10 @@ +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +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 diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index 6be55756c45..195101ed6b4 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -39,16 +39,10 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({ onload: function(doc, dt, dn) { var me = this; this._super(doc, dt, dn); - // if(doc.customer && !doc.quotation_to) - // doc.quotation_to = "Customer"; - // else if(doc.lead && !doc.quotation_to) - // doc.quotation_to = "Lead"; }, 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; @@ -129,6 +123,7 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({ var me = this; // to overwrite the customer_filter trigger from queries.js + this.frm.toggle_reqd("customer_lead", this.frm.doc.quotation_to); this.frm.set_query('customer_address', erpnext.queries.address_query); this.frm.set_query('shipping_address_name', erpnext.queries.address_query); }, diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json index 6ff33bdb621..83de49e2ab5 100644 --- a/erpnext/selling/doctype/quotation/quotation.json +++ b/erpnext/selling/doctype/quotation/quotation.json @@ -182,7 +182,7 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 1, + "reqd": 0, "search_index": 1, "set_only_once": 0, "translatable": 0, @@ -3224,7 +3224,7 @@ "istable": 0, "max_attachments": 1, "menu_index": 0, - "modified": "2019-04-01 17:21:09.462834", + "modified": "2019-04-02 10:06:27.850280", "modified_by": "Administrator", "module": "Selling", "name": "Quotation",