Show/Hide "Plus"(+) button on doc links

Hi, I need to hide the “+” button for some linked documents. Does anyone have any idea how to do it?

The below screenshot is captured from Sales Invoice. I checked the codes in Sales Invoice .js and .py files, but couldn’t find anything related to hiding the “+” button. Really appreciate if anyone can help

please check the code:

Hi NCP, Thank you for your reply. I checked the file but found nothing about the “+” button

If you want to add the action or something in + then you have to check the frm.custom_make_buttons line.

1 Like

I found something on frappe files and it works for me. i added these lines of code on the “overrides/js/doctype.js” of my application and it works ! ( in my case i just want to hide the Plus for the “Task” Link.)

frappe.ui.form.on("Project", {
onload(frm){
		document.querySelectorAll(".btn-new").forEach((el) => {
			if (el.getAttribute("data-doctype") == "Task") {
				el.style.display = "none"; 
			}
		});
	}
});
2 Likes