Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
5883 Zobrazení

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

Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Autor

Alright, I will do what you said. Thanks

Nejlepší odpověď

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>

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
bře 15
4191
1
led 25
1214
3
lis 24
1117
3
bře 24
4195
1
lis 22
2288