コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
6957 ビュー

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
8001
2
5月 21
19078
1
5月 19
6325
3
10月 18
19438
2
4月 17
4610