<odoo>

    <record id="account_asset_view_form" model="ir.ui.view">
        <field name="name">account.asset.form</field>
        <field name="model">account.asset</field>
        <field
            name="inherit_id"
            ref="account_asset_management.account_asset_view_form"
        />
        <field name="arch" type="xml">
            <button name="remove" position="after">
                <field name="can_transfer" invisible="1" />
                <field name="is_transfer" invisible="1" />
                <button
                    name="transfer"
                    string="Transfer"
                    type="object"
                    groups="account.group_account_manager"
                    attrs="{'invisible': [('can_transfer', '=', False)]}"
                    help="Transfer asset from AUC to Asset"
                />
            </button>
            <xpath expr="//header[last()]" position="after">
                <div
                    class="alert alert-warning"
                    role="alert"
                    style="margin-bottom:0px;"
                    attrs="{'invisible': ['|', ('can_transfer', '=', False), ('account_move_line_ids', '!=', [])]}"
                >
                    There are no journal entries on current asset(s), asset transfer will use account settings from the asset/asset profile instead.
                </div>
            </xpath>
            <xpath
                expr="//div[@name='button_box']/button[@name='open_entries']"
                position="before"
            >
                <button
                    name="open_assets"
                    string="Asset From"
                    type="object"
                    class="oe_stat_button"
                    context="{'asset_from': 1}"
                    attrs="{'invisible': [('is_transfer', '=', False)]}"
                    icon="fa-bars"
                />
                <button
                    name="open_assets"
                    string="Asset To"
                    type="object"
                    class="oe_stat_button"
                    context="{'asset_to': 1}"
                    attrs="{'invisible': [('is_transfer', '=', False)]}"
                    icon="fa-bars"
                />
            </xpath>
        </field>
    </record>

    <record id="account_asset_view_search" model="ir.ui.view">
        <field name="name">account.asset.search</field>
        <field name="model">account.asset</field>
        <field
            name="inherit_id"
            ref="account_asset_management.account_asset_view_search"
        />
        <field name="arch" type="xml">
            <xpath expr="//separator[last()]" position="before">
                <separator name="transfer" />
                <filter
                    string="Transferable"
                    name="can_transfer"
                    domain="[('can_transfer', '=', True)]"
                    help="Can be transferred"
                />
            </xpath>
        </field>
    </record>

</odoo>
