diff --git a/frappe/core/page/desktop/desktop.js b/frappe/core/page/desktop/desktop.js index f832236e0b..1fa30bb8ed 100644 --- a/frappe/core/page/desktop/desktop.js +++ b/frappe/core/page/desktop/desktop.js @@ -45,18 +45,20 @@ $.extend(frappe.desktop, { explore_icon.app_icon = frappe.ui.app_icon.get_html(explore_icon); all_icons.push(explore_icon); - var inbox_icon = { - module_name: 'Communication', - label: 'Email Inbox', - _label: __('Email Inbox'), - _id: 'Email Inbox', - _doctype: 'Communication', - icon: 'fa fa-envelope-o', - color: '#589494', - link: 'List/Communication/Inbox' + if(frappe.boot.email_accounts.length && frappe.model.can_read("Communication")) { + var inbox_icon = { + module_name: 'Communication', + label: 'Email Inbox', + _label: __('Email Inbox'), + _id: 'Email Inbox', + _doctype: 'Communication', + icon: 'fa fa-envelope-o', + color: '#589494', + link: 'List/Communication/Inbox' + } + inbox_icon.app_icon = frappe.ui.app_icon.get_html(inbox_icon) + all_icons.push(inbox_icon); } - inbox_icon.app_icon = frappe.ui.app_icon.get_html(inbox_icon) - all_icons.push(inbox_icon); frappe.desktop.wrapper.html(frappe.render_template(template, { // all visible icons diff --git a/frappe/public/js/frappe/list/list_sidebar.js b/frappe/public/js/frappe/list/list_sidebar.js index f016962e37..a883f9fb36 100644 --- a/frappe/public/js/frappe/list/list_sidebar.js +++ b/frappe/public/js/frappe/list/list_sidebar.js @@ -39,7 +39,7 @@ frappe.views.ListSidebar = Class.extend({ } //show link for kanban view this.sidebar.find('.list-link[data-view="Kanban"]').removeClass('hide'); - if(this.doctype === "Communication"){ + if(this.doctype === "Communication" && frappe.boot.email_accounts.length) { this.sidebar.find('.list-link[data-view="Inbox"]').removeClass('hide'); show_list_link = true; } diff --git a/frappe/public/js/frappe/views/inbox/inbox_no_result.html b/frappe/public/js/frappe/views/inbox/inbox_no_result.html index 443d61020a..688c9868e5 100644 --- a/frappe/public/js/frappe/views/inbox/inbox_no_result.html +++ b/frappe/public/js/frappe/views/inbox/inbox_no_result.html @@ -1,8 +1,12 @@
{{ __("No {} found", [doctype]) }}
-- -
+ {% if(!frappe.model.can_create(doctype) && doctype == "Email Account") { %} +Email Account is not assigned, Please contact System Manager
+ {% } else { %} +{{ __("No {} found", [doctype]) }}
++ +
+ {% } %}Email Account is not assigned, Please contact System Manager
-