Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
8510 Widoki

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...


Awatar
Odrzuć
Autor

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

Najlepsza odpowiedź

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}"/>

 

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
gru 19
3014
2
gru 23
14295
0
lis 23
1420
0
paź 23
33
3
paź 23
788