diff --git a/frappe/config/__init__.py b/frappe/config/__init__.py index 98561322f1..4e95927e9d 100644 --- a/frappe/config/__init__.py +++ b/frappe/config/__init__.py @@ -47,6 +47,9 @@ def get_modules_from_app(app): if module_name not in active_domains: to_add = False + if "condition" in m and not m["condition"]: + to_add = False + if to_add: active_modules_list.append(m) diff --git a/frappe/config/desktop.py b/frappe/config/desktop.py index 3ea060ae17..d92f8469af 100644 --- a/frappe/config/desktop.py +++ b/frappe/config/desktop.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals +import frappe from frappe import _ def get_data(): @@ -54,6 +55,7 @@ def get_data(): "icon": "octicon octicon-circuit-board", "type": "module", "system_manager": 1, + "condition": getattr(frappe.local.conf, 'developer_mode', 0), "hidden": 1, "description": "The Frappe innards of ERPNext. (Only active when developer mode is enabled)" }, diff --git a/frappe/public/js/frappe/views/components/ModuleDetail.vue b/frappe/public/js/frappe/views/components/ModuleDetail.vue index 446db3a03d..d2faa5df6d 100644 --- a/frappe/public/js/frappe/views/components/ModuleDetail.vue +++ b/frappe/public/js/frappe/views/components/ModuleDetail.vue @@ -10,7 +10,7 @@ :key="section.label + item.label" :data-youtube-id="item.type==='help' ? item.youtube_id : false" v-bind="item" - :open_count="frappe.boot.notification_info.open_count_doctype[item.doctype]" + :open_count="item.type==='doctype' ? frappe.boot.notification_info.open_count_doctype[item.doctype] : false" > diff --git a/frappe/public/js/frappe/views/components/Modules.vue b/frappe/public/js/frappe/views/components/Modules.vue index 29132e5fad..c561326055 100644 --- a/frappe/public/js/frappe/views/components/Modules.vue +++ b/frappe/public/js/frappe/views/components/Modules.vue @@ -35,7 +35,8 @@ export default { let route = frappe.get_route(); if(route[0] === 'modules' || !route[0]) { this.route = route; - let module_name = route[1]; + let module = this.modules_list.filter(m => m.module_name == route[1])[0]; + let module_name = module && (module.label || module.module_name); let title = this.current_module_label ? this.current_module_label : module_name; frappe.modules.home && frappe.modules.home.page.set_title(title); @@ -47,7 +48,7 @@ export default { } if(module_name) { - this.get_module_sections(module_name); + this.get_module_sections(module.module_name); } } },