no role access for financial analytics
diff --git a/accounts/page/accounts_home/accounts_home.html b/accounts/page/accounts_home/accounts_home.html
index 7fb2c32..5950173 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</a>
</div>
<div class="section-item">
- <a class="section-link"
+ <a class="section-link" data-role="Analytics"
title = "Analyze Sales and Purchase trends and slice them based on item, customer, groups etc"
href="#!Report/Profile/Trend Analyzer">Trend Analyzer</a>
</div>
<div class="section-item">
- <a class="section-link"
+ <a class="section-link" data-role="Accounts Manager"
title = "Check your Balance Sheet and Profit & Loss Statement"
href="#!Financial Statements">Financial Statements</a>
</div>
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 3752ebc..b30a6f9 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 @@
`tabContact`.phone,
`tabContact`.mobile_no,
`tabContact`.email_id
-from
+FROM
`tabCustomer`
left join `tabAddress` on (
`tabAddress`.customer=`tabCustomer`.name and
@@ -22,5 +22,7 @@
`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 71d012e..914df81 100644
--- a/startup/js/modules.js
+++ b/startup/js/modules.js
@@ -28,13 +28,19 @@
// 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('<span title="No read permission">'
+ +txt+'</span>');
+ }
+
// 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 @@
$(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 @@
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 @@
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('<span title="Only accessible by Roles: '+
+ $(this).attr("data-role")
+ +' and System Manager">'+html+'</span>');
}
});
}