Use Javascript rather than Python.
Google for: JS confirm method , alertify.js , jquery-confirm ...
examples: https://www.jquery-az.com/javascript-confirm-alert-box-fancy-and-simple-with-5-online-demos/
https://www.bitdegree.org/learn/javascript-alert-box/
A good places where to start in openERP Web dev: https://media.readthedocs.org/pdf/openerp-web-v7/latest/openerp-web-v7.pdf
http://frederic.vanderessen.com/client-side-development-with-openerp/
http://openerpbay.blogspot.com/2013/02/javascript-css-and-jquery-in-openerp-70.html
https://www.odoo.yenthevg.com/tag/javascript/
(Answer modified after comment).
In OpenERP you can create 3 types of Buttons (related to the Button's type attribute):
1_ Type object
2_ Type workflow
3_ Type action
Read te following links
https://openerp-server.readthedocs.io/en/latest/03_module_dev_03.html#button
http://blog.odoobiz.com/2014/10/openerpodoo-call-function-on-button.html
https://www.odoo.com/es_ES/forum/ayuda-1/question/add-button-to-form-view-85350
I think in your case you are dealing with the type="workflow".
To watch attentively: Workflow add button Customize workflows in Odoo
The best at last (but in French - an example for HR_Leave workflow modification): http://laboiteatice.fr/ecotice/diapo/co/modifier_processus.html?mode=html
WARNING:
When customizing a workflow, be sure you do not modify an existing node
or arrow, but rather add new nodes or arrows. If you absolutly need to
modify a node or arrow, you can only change fields that are empty or set
to the default value. If you don't do that, your customization will be
overwrited at the next update or upgrade to a future version of OpenERP.
To be continued ...
How to display confirmation display box / message box on button click.
Reference: https://goo.gl/6P7aR1