From 9c018fe984ae0c0bdc9b571adf0a6f1bce92501c Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 28 Jul 2014 12:58:50 +0530 Subject: [PATCH] [minor] Fixed address listing --- erpnext/buying/doctype/supplier/supplier.js | 8 ++++---- erpnext/selling/doctype/customer/customer.js | 8 ++++---- erpnext/setup/doctype/sales_partner/sales_partner.js | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/erpnext/buying/doctype/supplier/supplier.js b/erpnext/buying/doctype/supplier/supplier.js index c2b29a4a17..b5c7fb1b27 100644 --- a/erpnext/buying/doctype/supplier/supplier.js +++ b/erpnext/buying/doctype/supplier/supplier.js @@ -69,8 +69,8 @@ cur_frm.cscript.make_address = function() { page_length: 5, new_doctype: "Address", get_query: function() { - return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where supplier='" + - cur_frm.doc.name.replace("'", "\\'") + "' and docstatus != 2 order by is_primary_address desc" + return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where supplier='" + + cur_frm.doc.name.replace(/'/g, "\\'") + "' and docstatus != 2 order by is_primary_address desc" }, as_dict: 1, no_results_message: __('No addresses created'), @@ -88,8 +88,8 @@ cur_frm.cscript.make_contact = function() { page_length: 5, new_doctype: "Contact", get_query: function() { - return "select name, first_name, last_name, email_id, phone, mobile_no, department, designation, is_primary_contact from tabContact where supplier='" + - cur_frm.doc.name.replace("'", "\\'") + "' and docstatus != 2 order by is_primary_contact desc" + return "select name, first_name, last_name, email_id, phone, mobile_no, department, designation, is_primary_contact from tabContact where supplier='" + + cur_frm.doc.name.replace(/'/g, "\\'") + "' and docstatus != 2 order by is_primary_contact desc" }, as_dict: 1, no_results_message: __('No contacts created'), diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js index 9a4a356d17..e5d2ca9582 100644 --- a/erpnext/selling/doctype/customer/customer.js +++ b/erpnext/selling/doctype/customer/customer.js @@ -86,8 +86,8 @@ cur_frm.cscript.make_address = function() { page_length: 5, new_doctype: "Address", get_query: function() { - return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where customer='" + - cur_frm.doc.name.replace("'", "\\'") + "' and docstatus != 2 order by is_primary_address desc" + return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where customer='" + + cur_frm.doc.name.replace(/'/g, "\\'") + "' and docstatus != 2 order by is_primary_address desc" }, as_dict: 1, no_results_message: __('No addresses created'), @@ -105,8 +105,8 @@ cur_frm.cscript.make_contact = function() { page_length: 5, new_doctype: "Contact", get_query: function() { - return "select name, first_name, last_name, email_id, phone, mobile_no, department, designation, is_primary_contact from tabContact where customer='" + - cur_frm.doc.name.replace("'", "\\'") + "' and docstatus != 2 order by is_primary_contact desc" + return "select name, first_name, last_name, email_id, phone, mobile_no, department, designation, is_primary_contact from tabContact where customer='" + + cur_frm.doc.name.replace(/'/g, "\\'") + "' and docstatus != 2 order by is_primary_contact desc" }, as_dict: 1, no_results_message: __('No contacts created'), diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.js b/erpnext/setup/doctype/sales_partner/sales_partner.js index 64c4e2106c..118d2e29b4 100644 --- a/erpnext/setup/doctype/sales_partner/sales_partner.js +++ b/erpnext/setup/doctype/sales_partner/sales_partner.js @@ -41,8 +41,8 @@ cur_frm.cscript.make_address = function() { frappe.set_route("Form", "Address", address.name); }, get_query: function() { - return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where sales_partner='" + - cur_frm.doc.name.replace("'", "\\'") + "' and docstatus != 2 order by is_primary_address desc" + return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where sales_partner='" + + cur_frm.doc.name.replace(/'/g, "\\'") + "' and docstatus != 2 order by is_primary_address desc" }, as_dict: 1, no_results_message: __('No addresses created'), @@ -65,8 +65,8 @@ cur_frm.cscript.make_contact = function() { frappe.set_route("Form", "Contact", contact.name); }, get_query: function() { - return "select name, first_name, last_name, email_id, phone, mobile_no, department, designation, is_primary_contact from tabContact where sales_partner='" + - cur_frm.doc.name.replace("'", "\\'") + "' and docstatus != 2 order by is_primary_contact desc" + return "select name, first_name, last_name, email_id, phone, mobile_no, department, designation, is_primary_contact from tabContact where sales_partner='" + + cur_frm.doc.name.replace(/'/g, "\\'") + "' and docstatus != 2 order by is_primary_contact desc" }, as_dict: 1, no_results_message: __('No contacts created'),