<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
    <record id="repair_type_form_inherit" model="ir.ui.view">
        <field name="name">repair.type.inherit</field>
        <field name="model">repair.order</field>
        <field name="inherit_id" ref="repair.view_repair_order_form" />
        <field name="arch" type="xml">
            <header position="inside">
                <button
                    name="action_transfer_done_moves"
                    string="Create Transfer"
                    type="object"
                    attrs="{'invisible': ['|', ('state','!=', 'done'), ('remaining_quantity', '=', 0)]}"
                />
            </header>
            <xpath expr="//div[hasclass('oe_button_box')]" position="inside">
                <field name="remaining_quantity" invisible="1" />
                <field name="picking_ids" invisible="1" />
                <button
                    name="action_open_transfers"
                    type="object"
                    class="oe_stat_button"
                    icon="fa-truck"
                    attrs="{'invisible': [('picking_ids', '=', False)]}"
                >
                        <div class="o_field_widget o_stat_info">
                            <span class="o_stat_text">Transfers</span>
                        </div>
                </button>
            </xpath>
        </field>
    </record>
</odoo>
