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

I need to detect when a user is in add (new) mode when the view is loaded or in edit mode.

I need this because I want to hide a few fields when the user is adding a new entry and show them when the user is editing an entry.

TIA

頭像
捨棄
最佳答案

Use invisible attribut with dynamic conditions. See for example:

<field name="field1"/>
<field name="field2" attrs="{'invisible':[('field1','=','some_value')]}"/>

field2 will show or not depended from value field1.

頭像
捨棄