Skip to Content
Menu
This question has been flagged
1 Reply
3390 Views

in my module a username field was included..how can i add a  search option to filter by this field username.

Avatar
Discard
Best Answer

Hello Jishnu,


You can add filter using inheritance.

For Ex:- If you want add filter in Customer then inherit the customer filter or search view and add your field inside that.


<record model="ir.ui.view" id="res_partner_search_view_inherit_custom">
        <field name="name">res.partner.search.view.custom</field>
        <field name="model">model.name</field>
        <field name="inherit_id" ref="module_name.id_of_search_view"/>
        <field name="arch" type="xml">
            <field name="field_name" position="after"> #Here field_name is which field after you add your field filter
                <field name="your_field"/>
            </field>
        </field>
    </record>


Hope it will helps you.

Thanks,

Avatar
Discard
Author

thank you..it works perfectly