Trigger script when button clicked on Single custom doctype


I have new single custom doctype which have button for create new Journal Entry.

is it possible to make trigger to python script on Frappe or ERPNext ?
I don’t know if it use Server Script or Client Script


I’m try using js file on my custom app for script, but not triggered. As for python script, I still no idea how to trigger it.

Thank you !