<?xml version="1.0" encoding="utf-8"?>
<odoo>

    <record id="view_order_form_clover_button" model="ir.ui.view">
        <field name="name">sale.order.form.clover.button</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form"/>
        <field name="priority">60</field>
        <field name="arch" type="xml">
            <xpath expr="//button[@id='create_invoice']" position="after">
                <field name="clover_provider_enabled" invisible="1"/>
                <button name="action_clover_collect_payment"
                        string="Collect Payment"
                        type="object"
                        class="btn-secondary"
                        icon="fa-credit-card"
                        invisible="state not in ('sale', 'done') or not clover_provider_enabled"
                        groups="fusion_clover.group_fusion_clover_user"
                        data-hotkey="p"/>
            </xpath>
        </field>
    </record>

</odoo>
