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

Can I use "if" in a xml file (tree view)? How can I do this? e.g:

<if........>
<field name="name" />
<if......./>
アバター
破棄
最善の回答

You can use the attrs attribute on form fields, to make them contitionally visible or required.

From the documentation:

attrs: Permits to define attributes of a field depends on other fields of the same window. (It can be use on page, group, button and notebook tag also)

Example:

<field name="volume" attrs="{'readonly':[('type','=','service')]}"/>

Views also use the QWeb template engine, used in many Kanban views, and it includes a t-if=condition element, but this is not very well documented.

アバター
破棄