Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
5914 มุมมอง

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>

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 15
4209
1
ม.ค. 25
1232
3
พ.ย. 24
1131
3
มี.ค. 24
4241
1
พ.ย. 22
2305