<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="view_purchase_request_form" model="ir.ui.view">
        <field name="model">purchase.request</field>
        <field name="inherit_id" ref="purchase_request.view_purchase_request_form" />
        <field name="arch" type="xml">
            <button
                name="%(purchase_request.action_purchase_request_line_make_purchase_order)d"
                position="attributes"
            >
                <attribute
                    name="attrs"
                >{'invisible': ['|',('reduce_step', '=', True)]}</attribute>
            </button>
            <field name="requested_by" position="before">
                <field name="reduce_step" invisible="1" />
                <field
                    name="request_type"
                    required="True"
                    attrs="{'readonly': [('is_editable','=', False)]}"
                />
            </field>
        </field>
    </record>
    <record id="view_purchase_request_tree" model="ir.ui.view">
        <field name="model">purchase.request</field>
        <field name="inherit_id" ref="purchase_request.view_purchase_request_tree" />
        <field name="arch" type="xml">
            <field name="state" position="before">
                <field
                    name="request_type"
                    invisible="context.get('group_by') == 'request_type'"
                />
            </field>
        </field>
    </record>
    <record id="view_purchase_request_search" model="ir.ui.view">
        <field name="model">purchase.request</field>
        <field name="inherit_id" ref="purchase_request.view_purchase_request_search" />
        <field name="arch" type="xml">
            <field name="requested_by" position="before">
                <field name="request_type" />
            </field>
            <group position="inside">
                <filter
                    name="request_type"
                    domain="[]"
                    context="{'group_by': 'request_type'}"
                />
            </group>
        </field>
    </record>
</odoo>
