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

Hi,

I would like to display different fields of the same model on different pages of the same notebook.  I have provided code below to better explain what I would like to obtain.

I have tried different approaches but noone worked. Any suggestions? I use v 12.0

Regards,

<notebook>
<page string="Tab 1">
<field name="line_ids">
<tree editable="bottom">
<field name="field1_model_abc_line"/>
<field name="field2_model_abc_line"/>
</tree>
</field>
</page>
<page string="Tab 2">
<field name="line_ids">
<tree editable="bottom">
<field name="field1_model_abc_line"/>
<field name="field2_model_abc_line"/>
<field name="field3_model_abc_line"/>
</tree>
</field>
</page>
</notebook>

頭像
捨棄
最佳答案

For your case, one "line_ids" field should be readonly and suggest you to make readonly which line_ids is show fewer fields.

Because if you add data into Tab 2 line ids, it will also effect to Tab 1 line_ids.

Only Tab 2 can able to make add an item.

I make some changes below and please try again.

<notebook>
<page string="Tab 1">
        <field name="line_ids" readonly="1">
            <tree>
<field name="field1_model_abc_line"/>
<field name="field2_model_abc_line"/>
                <field name="field3_model_abc_line" invisible="1"/>
</tree>
</field>
</page>
<page string="Tab 2">
<field name="line_ids">
<tree editable="bottom">
<field name="field1_model_abc_line"/>
<field name="field2_model_abc_line"/>
<field name="field3_model_abc_line"/>
</tree>
</field>
</page>
</notebook>
頭像
捨棄
最佳答案

Is it possible if we want to remove field2_model_abc_line from Tab 2?

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
8月 22
4512
3
9月 24
15687
1
1月 21
7162
2
12月 19
9709
3
3月 16
4374