<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <!-- Asset Register -->
    <record id="view_account_asset_search" model="ir.ui.view">
        <field name="name">account.asset.search</field>
        <field name="model">account.asset</field>
        <field name="inherit_id" ref="exp_asset_base.view_account_asset_search"/>
        <field name="arch" type="xml">
            <field name="analytic_distribution" position="after">
                <field name="employee_id"/>
                <field name="department_id"/>
                <field name="location_id"/>
            </field>
            <filter name="cost_center" position="after">
                <filter string="Employee" name="employee" domain="[]" context="{'group_by':'employee_id'}"/>
                <filter string="Department" name="department" domain="[]" context="{'group_by':'department_id'}"/>
                <filter string="Location" name="location" domain="[]" context="{'group_by':'location_id'}"/>
                <filter string="Custody Type" name="custody_type" domain="[]" context="{'group_by':'custody_type'}"/>
            </filter>
        </field>
    </record>
    <record model="ir.ui.view" id="view_account_asset_form">
        <field name="name">account.asset.form</field>
        <field name="model">account.asset</field>
        <field name="inherit_id" ref="odex30_account_asset.view_account_asset_form"/>
        <field name="arch" type="xml">
            <div name="button_box" position="inside">
                <button class="oe_stat_button" name="open_asset_operation" type="object" icon="fa-pencil">
                    <field string="Operations" name="asset_operation_count" widget="statinfo"/>
                </button>
            </div>
            <notebook position="before">
                <group string="Custody Info" invisible="state != 'model' or asset_type != 'purchase'" >
                    <group>
                        <field name="custody_type" readonly="1"/>
                        <field name="purpose" readonly="1"/>
                        <field name="custody_period" readonly="1"/>
                        <field name="return_date" readonly="1"/>
                    </group>
                    <group>
                        <field name="status" readonly="1"/>
                        <field name="department_id" readonly="1"/>
                        <field name="employee_id" readonly="1"/>
                        <field name="location_id" readonly="1"/>
                    </group>
                </group>
            </notebook>
        </field>
    </record>

</odoo>
