fix: Patch to move customer and lead

This commit is contained in:
deepeshgarg007
2019-04-02 10:15:59 +05:30
parent ff99492481
commit 1638994436
4 changed files with 15 additions and 9 deletions

View File

@@ -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
erpnext.patches.v11_1.set_variant_based_on
erpnext.patches.v11_1.move_customer_lead_to_dynamic_column

View File

@@ -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' """)

View File

@@ -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);
},

View File

@@ -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",