콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
10414 화면

Hi i have an existing search view,i have inherited it and added my own filter on it,,,,its working fine but i want to remove the previous filter from the list too,,how can i do that??

here is my code

<record model="ir.ui.view" id="society_search">
<field name="name">real_estate society_search</field>
<field name="model">society</field>
<field name="inherit_id" ref="real_estate.society_search"/>
<field name="arch" type="xml">
<search>
<group expand="0" string="Group By">
<filter name='Building' string="Building" domain="[]" context="{'group_by':'society_id'}"/>
</group>
</search>
</field>
</record>
아바타
취소
베스트 답변

There are 2 options to remove it.

1: Hide it (invisible="1"):

    <filter name="filter1" position="attributes">
        <attribute name="invisible">1</attribute>
    </filter>

2: Replace the filter (position="replace"):

    <filter name="filter1" position="replace"/>


아바타
취소
베스트 답변

you can override the view by this way:

on your inherited search view

    <record model="ir.ui.view" id="society_search">
<field name="name">real_estate society_search</field>
<field name="model">society</field>
       <field name="inherit_id" ref="real_estate.society_search"/>
       <field name="arch" type="xml">

            <xpath expr="//filter[@name='filter_name_that_you_want_to_remove']" position="replace">

                <filter name="your_new_filter_name" . . . />

            </xpath>

</field>
</record>

아바타
취소