Remove help from desk

A non instrusive way to achive this is through a custom app.

In a custom app in hooks.py configure the app_include_js variable with something like:
app_include_js = "/assets/yourapp/js/hide_help_menu.js"

Under /yourapp/public/ folder create the hide_help_menu.js file with

$(function() {
	$('.dropdown-help').hide();  // or .remove();
});
10 Likes

Hi Froldan,

i’m a ASP.Net developer and doing integrations with ERP of different modules.

can you explain a little more about “Custom App”. is ii the same thing which we create using

“bench new-site SiteName”

i’m little confuse about Custom App

Thanks

Hi Adnan

A site creates with bench new-site sitename is a new instance wich can have multiple apps installed, eg: erpnext, erpnext_shopify, etc.

A Custom App is an app which can be installed in multiple sites.

To create a new app, you should run bench new-app myappname and then install it in your site with bench --site yoursite install-app mysappname

The new app lives in the /apps/ folder inside your bench, you can open it with your favorite ide or text editor and start to code without a worry in change the frappe / erpnext code.

You can refer to http://frappe.github.io/frappe/user/en/tutorial/ and https://frappe.github.io/frappe/user/en/guides/basics/hooks

I will glad to help you with further questions.

1 Like

Hi Froldan,

Thanks a lot for your detail answer. will test if on my new server.

Thanks.
Adnan

Hi @froldan, I have questions,
1.
How I find hook.py location?
Ex: /home/[user/frappe-bench/… ?

After editing I just save and reload the page or what else to do?

Thank for your help!

Hi, @nguyenrom.

  1. Did you create the custom app with the bench new-app yourcustomapp command?
    In this case, you can find the hook.py file under /home/user/frappe-bench/apps/yourcustomapp/yourcustomapp/hooks.py

  2. After editing you should clear the cache and reload the page and if you are working on a server you should do a sudo bench restart

Hope it helps! do not hesitate to ask again

1 Like

Hi @froldan, I just made sudo python install.py --production --user nguyen

My VPS:
root@150-95-105-163:/home/nguyen/frappe-bench/apps# ls
erpnext frappe

So, do I need to add more custom app to customizing ERP?

Yes, you need to create a custom app and install it on your site.
At this moment you don’t have any custom app created, only have erpnext and frappe app.

I recommend you to make this tutorial first in order to achieve basic knowledge.

1 Like

I think sudo python install.py --production --user nguyen is done, but not! I’ll try step y step! Thanks @froldan so much! :sunny:

Hello @froldan

At this point I’ve followed all your steps

Added js file to public folder

Added hooks.py line to js. Although this doesnt look like the path to our js (I dont know).
hooks

Did a sudo bench restart.

Installed the app to my site via bench.

JS Console shows that js file cannot be retrieved:

Loading failed for the with source “http://demo.outsourcenow.us/assets/pro_enterprise/js/hide_help_menu.js?ver=1505747028.0”.

I’m not getting the needed result. I’m I missing something?

I’m running ERPNext 8.

I think that you must move the hide_help_menu.js file inside the js folder or instead change the path in your hooks to "/assets/pro_enterprise/hide_help_menu.js".
Also you can use the developers tools to see if the file is loaded

I made a copy in /js directory. Still the same result.

Maybe a bench update --build is needed, could you try with that? also bench restart

Thanks, though normally bench update is a scary command to run :sweat_smile:

Hmmm… running bench update --build worked. Can u tell me in brief what this does and how safe it is to run on a production server?

Thanks alot @froldan !

Yes, bench update is a very scary command, but I think that does it with --build flag is safe (it would be a good idea to ask someone from the frappe team).

bench update --build build JS and CSS artifacts for the bench as the cheatsheet says.

you are welcome, I glad to help

1 Like

Cheers :grin:

I try this at my local machine, but I get below error at my chrome console:

When I click on the link, its show 404, check below image:

But when I right click on it, this link open it in new tap perfectly. It contain all the html code and other thing, except the java script code that I was wrote:
$(function() {
$(‘.dropdown-help’).hide();
});

Edit: Please check the embedded link of that file, which displays the code.
js file

Any suggestion.

-Ashfaq

lets discuss this here: https://discuss.frappe.io