تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
5878 أدوات العرض

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
مارس 15
4189
1
يناير 25
1212
3
نوفمبر 24
1115
3
مارس 24
4193
1
نوفمبر 22
2287