Hide 'Make Salary Slip' button in Salary Structure

Hi Guys,

Is there any way to hide the make salary slip in the ‘salary structure’.

I have checked on the customization form for the ‘salary structure’, there is no button to hide.

Thanks!

The button is rendered via a java script. You will need to write a JS to hide it. Any reason why you wish to hide it ?

Which version are you on? It has been removed in latest version.

Hi.thanks for reply, we wish to hide it because we have preference requirements to do directly from Salary Slip - >New, and not from salary structure.

Owh…we are currently using version 7.0.29

Not planning to upgrade to the latest version because our client has gone live with a previous version of ERPNext and we have yet to test our customization against the latest ERPNext version.

Try this:

Change “Material Request” to “Salary Slip” or whatever button you want to hide. If alot of people require this, I can create a PR for it.

// Remove Existing Material Request Button

var $group = cur_frm.page.get_inner_group_button("Make");

for (i = 0; i < $group.find(".dropdown-menu").children("li").length; i++) {
	var li = $group.find(".dropdown-menu").children("li")[i];
	if (li.getElementsByTagName("a")[0].innerHTML == "Material Request")
		$group.find(".dropdown-menu").children("li")[i].remove();
}
1 Like