跳至內容
選單
此問題已被標幟
3 回覆
5894 瀏覽次數

Hi I'm trying to add default filter to Contact app.

What I'm trying to do is below

<record id="eric_default_contact_filter" model="ir.actions.act_window">

<field name="name">Public Contact</field>

<field name="res_model">res.partner</field>

<field name="view_type">form</field>

<field name="view_mode">kanban,tree,form</field>

<field name="context">{'search_default_filter_public_contact':1}</field>

<field name="search_view_id" ref="base.action_partner_form"/>

<field name="help" type="html">

<p><b>No module found!</b></p>

<p>You should try others search criteria.</p>

</field>

</record>


But After spending hours, default filter button doesn't show up in the search block.


Please let me know

頭像
捨棄
最佳答案

I think You can achieve the same by, copying the original record into the custom module and change its id to "module_name.original_id" and add desired filter into it

頭像
捨棄
作者

Alright, I will do what you said. Thanks

最佳答案

You have to inherit the windows action. See my code ...

<record id="contacts.action_contacts" model="ir.actions.act_window">
        <field name="name">Contacts</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">res.partner</field>
        <field name="view_mode">tree,kanban,form</field>
        <field name="view_type">form</field>
        <field name="view_id" ref="base.view_partner_tree"/>
        <field name="context">{'search_default_filter_public_contact':1}</field>
    </record>

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
3月 15
4196
1
1月 25
1219
3
11月 24
1120
3
3月 24
4201
1
11月 22
2295