Suppose you want to add a confirmation message to a purchase order. Here is an example below:
<record id="view_purchase_order_form_confirm_msg" model="ir.ui.view">
<field name="name">view.purchase.order.form.confirm.msg</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@id='draft_confirm']" position="replace">
<button name="button_confirm" type="object" states="draft"
string="Confirm Order" id="draft_confirm"
confirm="Are you sure you want to Confirm this order? "/>
</xpath>
<xpath expr="//button[@name='button_cancel']" position="replace">
<button name="button_cancel"
states="draft,to approve,sent,purchase"
string="Cancel" type="object"
confirm="Are you sure you want to Cancel this order? "/>
</xpath>
</field>
</record>