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

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?

頭像
捨棄
最佳答案

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,

頭像
捨棄
最佳答案

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>

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
9月 23
8009
2
5月 21
19079
1
5月 19
6327
3
10月 18
19442
2
4月 17
4611