ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

How to hide modules displayed on side bar

How to hide some of the modules like Education and CRM from the side bar?

Thanks in advance.

hid

you can go to file
/home/frappe/frappe-bench/sites/assets/css/desk.min.css
and in this class

.layout-side-section {
  font-size: 12px;
  padding-right: 0px;
}

add
display:none;

You can hide modules based on Role Permissions for specific Users.

2 Likes

how about administrator?..i don’t want to show some Manu Topic…in administrator also.

if you like to hide that. create another administrator for this to hide some modules.

I still get some modules I dont want showing for a user. How can I reliably and permanently hide these?

Could be a powerful ERPNext feature to implement in the core. I imagine its simple but highly sought after by many.

open file: apps/frappe/frappe/desk/page/modules/modules.js
and edit get_module_sidebar_item

@s_Mafutta. You want to remove selected modules only, say remove Agriculture and Healthcare. I would imagine making an IF statement. Not sure about the JavaScript syntax but something like:

let get_module_sidebar_item = (item) => if(item.module_name != "Agriculture" || item.module_name != "Healthcare"){ 
   
   `<li class="strong module-sidebar-item">
       
		<a class="module-link" data-name="${item.module_name}" href="#modules/${item.module_name}">
			<i class="fa fa-chevron-right pull-right" style="display: none;"></i>
			<span>${item._label}</span>
		</a>

	</li>`
 };

Github reference file. Will appreciate some guidance on the right syntax.

remove permission from “ALL” user. When setting perms, instead of selecting for admin, set for “ALL” and remove access perms. DONE… 100% Working.

Hello,
We found an alternative way to do this.
Go to Module Def List>Assign the Module to a Domain that is not in use
This hides the module from the side bar

P.S: Make sure this does not affect any other dependency

1 Like

Hi,
Replace get_module_sidebar_item function by following:

get_module_sidebar_item = function(item) {
if(item.module_name!=‘Agriculture’){
return <li class="strong module-sidebar-item"> <a class="module-link" data-name="${item.module_name}" href="#${item.link}"> <i class="fa fa-chevro lln-right pull-right" style="display: none;"></i> <span>${item._label}</span> </a> </li>;
}

}

Hello. Does this work? If yes, where do I write this to override the current method? I sure cannot modify the core code right?