How to apply custom scripts (client and server side)

I want to add a custom document type to ERPNext. I created the files PY and JS for doctype and put them in /erpnext/erpnext/doctypes/manufacturing (because the doctype belongs to the Manufacturing module). Then, I executed the commands bench clear-cache && bench update --build.
After this, I thought that I would not have to do anything else, but it seems that the scripts do not apply to ERPNext.
What are the correct steps?

No, either you have not understood me correctly or I have explained it in the wrong way.
I have created a custom doctype and it is visible in ERPNext, but the code I have written to add functionality to that doctype has no effect on the doctype and I am sure I have skipped some step in the process to “load” the code (PY and JS files) in ERPNext.

Hi @vazdan,

I think the issue you see is that you have a custom doctype in the standard manufacturing module. Custom doctypes are typically only in the database, not in the file structure (check by looking for the .json file). By the way, the command to load new server side code in a productive system is bench migrate && bench restart.

A robust way of doing this is to either put your custom doctype as a standard doctype in a separate app or to fork/branch erpnext and then make it “standard”. Maybe it is even relevant for someone else and you might want to create a pull request?

You can also leave the app as custom, put your server side code in a custom app and add the server side code in a custom script. Altough, you probably want to document this, because it scatters the contens…

Hope this helps.