[fix] address queries + tests

This commit is contained in:
Rushabh Mehta
2017-01-16 13:06:07 +05:30
parent 120461efef
commit 8d39fd9790
13 changed files with 31 additions and 33 deletions

View File

@@ -32,7 +32,7 @@ frappe.ui.form.on("Customer", {
erpnext.toggle_naming_series();
}
frappe.contact_link = {doc: frm.doc, fieldname: 'name', doctype: 'Customer'}
frappe.dynamic_link = {doc: frm.doc, fieldname: 'name', doctype: 'Customer'}
frm.toggle_display(['address_html','contact_html'], !frm.doc.__islocal);

View File

@@ -67,12 +67,8 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
this.frm.toggle_reqd("customer", this.frm.doc.quotation_to == "Customer");
// to overwrite the customer_filter trigger from queries.js
$.each(["customer_address", "shipping_address_name"],
function(i, opts) {
me.frm.set_query(opts, me.frm.doc.quotation_to==="Lead"
? erpnext.queries["lead_filter"] : erpnext.queries["customer_filter"]);
}
);
this.frm.set_query('customer_address', erpnext.queries.address_query);
this.frm.set_query('shipping_address_name', erpnext.queries.address_query);
},
tc_name: function() {