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

So, i bored each time configure views by hands in odoo and decided to create module that contains all changes.

When i go to contacts app, I need tree view load by default.

So how this done? What I supose to put in views.xml?

Avatar
Zrušit
Nejlepší odpověď

Hello,

You need to update view_mode in action and sequence of view in action.
You can write as following in your custom module to update it.

<record id="contacts.action_contacts" model="ir.actions.act_window">
	<field name="view_mode">tree,form,kanban</field>
</record>
<record id="contacts.action_contacts_view_kanban" model="ir.actions.act_window.view">
	<field name="sequence" eval="4"/>
	<field name="view_mode">kanban</field>
	<field name="view_id" ref="base.res_partner_kanban_view"/>
	<field name="act_window_id" ref="contacts.action_contacts"/>
</record>

Thanks,

Avatar
Zrušit
Nejlepší odpověď

You have to inherit windows action like this ... but for me this doesn't work either ...

<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
2
zář 23
7989
2
kvě 21
19040
1
kvě 19
6317
3
říj 18
19417
2
dub 17
4605