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

Hello Guys. Can some help with how to do checkboxes but the options are added through a selection field or can be added manually... and only one should be selected at a time.

I need both the python code and xml for view.

Thanks...


アバター
破棄
著作者

Thanks, Waleed Mohsen, Am going to use radio buttons however much, How can I organize the radio buttons like putting three per row...

最善の回答

You will use radio widget:

Add field in py:

type = fields.Selection(string='Type', selection=[('A', 'A'), ('B', 'B')])

in XML View,

<field name="type" widget="radio" >

If you want the radio boxes to show horizontally you will add options="{'horizontal': true}" 

<field name="type" widget="radio"  options="{'horizontal': true}"/>

 

アバター
破棄
関連投稿 返信 ビュー 活動
1
12月 19
3012
2
12月 23
14237
0
11月 23
1410
0
10月 23
33
3
10月 23
788