This question has been flagged
3 Replies
5841 Views

I inherit the res.partner form in odoo 10. I don't  want some fields in both 'filter' and 'group by' mode in advance search view-

I did it in this way- but it didn't work for me. Is there any solution for this?

<record id="view_inherit_filter" model="ir.ui.view">
    <field name="name">res.partner.select.inherit</field>
    <field name="model">res.partner</field>
    <field name="inherit_id" ref="base.view_res_partner_filter"/>
    <field name="arch" type="xml">
        <search string="Search Partner">
            <xpath expr="filter[@string='Customers']" position="attributes">
                <attribute name='invisible'>1</attribute> 
            </xpath>
 </search>
    </field>
</record>


Avatar
Discard
Best Answer

Hi manjima,

Please add like this <filter name="customer" position="replace"/>

you can't give invisible for filters.

Thanks


Avatar
Discard
Author Best Answer

I did it in the following way and its work for me.

<record id="view_inherit_filter" model="ir.ui.view">
<field name="name">res.partner.select.inherit</field>
    <field name="model">res.partner</field>
    <field name="inherit_id" ref="base.view_res_partner_filter"/>
     <field name="arch" type="xml">
       <!--hide advanced view search -->
<xpath expr="//search/filter[1]" position="attributes">
    <attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//search/filter[2]" position="attributes">
    <attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//search/filter[3]" position="attributes">
    <attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//search/filter[5]" position="attributes">
    <attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//search/filter[6]" position="attributes">
    <attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//search/filter[7]" position="attributes">
    <attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//search/group/filter[1]" position="attributes">
    <attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//search/group/filter[2]" position="attributes">
    <attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//search/group/filter[3]" position="attributes">
    <attribute name="invisible">1</attribute>
</xpath>
      
</field>
</record>

Avatar
Discard