From 224714c24881572401bf23145a1397a0b8ed5671 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 28 Sep 2012 10:23:27 +0530 Subject: [PATCH] no role access for financial analytics --- .../page/accounts_home/accounts_home.html | 4 ++-- .../customer_address_contact.sql | 8 +++++--- startup/js/modules.js | 20 ++++++++++++------- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/accounts/page/accounts_home/accounts_home.html b/accounts/page/accounts_home/accounts_home.html index 7fb2c326ee..5950173c5b 100644 --- a/accounts/page/accounts_home/accounts_home.html +++ b/accounts/page/accounts_home/accounts_home.html @@ -69,12 +69,12 @@ href="#!Form/Sales and Purchase Return Tool/Sales and Purchase Return Tool">Sales or Purchase Returns
- Trend Analyzer
- Financial Statements
diff --git a/selling/search_criteria/customer_address_contact/customer_address_contact.sql b/selling/search_criteria/customer_address_contact/customer_address_contact.sql index 3752ebc04e..b30a6f9f09 100644 --- a/selling/search_criteria/customer_address_contact/customer_address_contact.sql +++ b/selling/search_criteria/customer_address_contact/customer_address_contact.sql @@ -1,4 +1,4 @@ -select +SELECT `tabCustomer`.name, `tabCustomer`.customer_name, `tabAddress`.address_line1, @@ -12,7 +12,7 @@ select `tabContact`.phone, `tabContact`.mobile_no, `tabContact`.email_id -from +FROM `tabCustomer` left join `tabAddress` on ( `tabAddress`.customer=`tabCustomer`.name and @@ -22,5 +22,7 @@ from `tabContact`.customer=`tabCustomer`.name and ifnull(`tabContact`.is_primary_contact, 0)=1 ) -order by +WHERE + `tabCustomer`.docstatus<2 +ORDER BY `tabCustomer`.customer_name asc \ No newline at end of file diff --git a/startup/js/modules.js b/startup/js/modules.js index 71d012e44b..914df8116d 100644 --- a/startup/js/modules.js +++ b/startup/js/modules.js @@ -28,13 +28,19 @@ erpnext.module_page.setup_page = function(module, wrapper) { // not have read permissions erpnext.module_page.hide_links = function(wrapper) { + function replace_link(link) { + var txt = $(link).text(); + $(link).parent().css('color', '#999'); + $(link).replaceWith('' + +txt+''); + } + // lists $(wrapper).find('[href*="List/"]').each(function() { var href = $(this).attr('href'); var dt = href.split('/')[1]; if(wn.boot.profile.all_read.indexOf(get_label_doctype(dt))==-1) { - var txt = $(this).text(); - $(this).parent().css('color', '#999').html(txt); + replace_link(this); } }); @@ -42,8 +48,7 @@ erpnext.module_page.hide_links = function(wrapper) { $(wrapper).find('[data-doctype]').each(function() { var dt = $(this).attr('data-doctype'); if(wn.boot.profile.all_read.indexOf(dt)==-1) { - var txt = $(this).text(); - $(this).parent().css('color', '#999').html(txt); + replace_link(this); } }); @@ -52,8 +57,7 @@ erpnext.module_page.hide_links = function(wrapper) { var href = $(this).attr('href'); var dt = href.split('/')[1]; if(wn.boot.profile.all_read.indexOf(get_label_doctype(dt))==-1) { - var txt = $(this).text(); - $(this).parent().css('color', '#999').html(txt); + replace_link(this); } }); @@ -62,7 +66,9 @@ erpnext.module_page.hide_links = function(wrapper) { if(!has_common(user_roles, [$(this).attr("data-role"), "System Manager"])) { var html = $(this).html(); $(this).parent().css('color', '#999'); - $(this).replaceWith(html); + $(this).replaceWith(''+html+''); } }); }