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

Hi, I have two trees and two forms for one model. Right now this is the setup

Tree A
Form A
Action A (Links to Tree A)

Tree B
Form B
Action B (Links to Tree B)

Problem: in Tree B, when I click on any item in the table, it goes to Form A. 

How do I specifically tell Tree B to use Form B instead?

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

You need to define action with specific view IDs for tree and form views
eg:

<record model="ir.actions.act_window" id="action_account_asset_form">

    <field name="name">Assets</field>

    <field name="res_model">account.asset</field>

    <field name="view_ids" eval="[(5, 0, 0),

        (0, 0, {'view_mode': 'tree', 'view_id': ref('view_account_asset_tree')}),

        (0, 0, {'view_mode': 'form', 'view_id': ref('view_account_asset_form')})]"/>

    <field name="help" type="html">

        <p class="o_view_nocontent_smiling_face">

            Create new asset

        </p>

    </field>

</record>

Hope it helps,
Kiran K



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

stock.predictor.partner.form
stock.predictor
form














stock.predictor.partner.dashboard.tree
stock.predictor


/>








Partner Dashboard
ir.actions.act_window
tree,form

/>


View Our Partner Dashboard



Here is my code, I've tried your method but it doesn't work

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

Hi Zeyad Naguib ,

in action A add two views [list, form]:

<field name="view_ids" eval="[(5, 0, 0),
        (0, 0, {'view_mode': 'tree', 'view_id': ref('listA')}),

        (0, 0, {'view_mode': 'form', 'view_id': ref('formA')}),
    ]"/>


The same to action B

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 5 20
7588
2
thg 11 18
13350
2
thg 3 16
7635
1
thg 3 15
8323
0
thg 3 15
4324