Trigger script when button clicked on Single custom doctype

Hello,

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

telegram-cloud-photo-size-5-6221763150986983974-x

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 !