Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
7895 Lượt xem

Hi,

how can I make 2 views for the same object? Which are displayed depending on the place I am?

For example I have one tree view which is available from 2 menus. Depending on this menu, I have a context={'management': True} or False in the action XML.

But these two menus opens the same tree, and I want to show the form view (object view) differently depending on this context.

Can someone help me? Thanks!

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

First you have to assign different priorities on the xml for your tree views

<record id="custom_form_tree" model="ir.ui.view">
        <field name="model">custom.model</field>
        <field eval="4" name="priority"/>
        <field name="arch" type="xml">

And on your action you have to set the tree view

<field name="view_id" ref="custom_form_tree"/>

This is going to work.

Ảnh đại diện
Huỷ bỏ
Tác giả

thank you, but in fact the tree view is not the problem, it's when I want to open the form view from the tree view (by clicking a row), So I want to make the form view different depending on which tree view I am... Sorry if I did not explain well

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 2 23
3560
0
thg 2 17
5663
3
thg 3 17
10108
1
thg 11 24
2098
0
thg 4 24
44