Try ERPNext Buy Support Partners Foundation

What triggers a javascript reload in add-on

What will trigger the reload of .js files in a module? I thought “Reload” from the user menu would do it since it will reload changes to DocTypes, but the only thing I have found so far was to run bench migrate, which takes a little while.


Which files did you change, exactly?

In my custom app, where I’ve added a doctype, I’ve added a button. So something like my_app/my_app/doctype/test_tool/test_tool.pyjs

Edit: I meant to put .js, not .py

I thought it was a JS file. Anyway, I use these commands on production server’s bench folder:

python -m compileall apps/my_app/my_app/doctype/test_tool/
bench clear-cache
bench restart

But on the development environment you don’t need to use these commands. Bench detects file changes and compiles files for you on the fly when you issue ‘bench start’.

So, I use these commands on my development machine and I don’t need to do compile, restart, migrate or anything.

sudo supervisorctl stop all
bench start
1 Like

I put the wrong path, I did mean my_app/my_app/doctype/test_tool/test_tool.js

Thanks for the information, that makes sense. I wasn’t thinking about the fact I typically run on a development instance but this instance is set to production. Looks like if I’m changing a javascript file I could probably just run bench clear-cache and bench restart to get my changes to show up.

What is the difference in running

sudo supervisorctl stop all 
bench start 

instead of running bench restart?