Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
8460 Vues

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


Avatar
Ignorer
Auteur

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

Meilleure réponse

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

 

Avatar
Ignorer
Publications associées Réponses Vues Activité
1
déc. 19
3001
2
déc. 23
14191
0
nov. 23
1372
0
oct. 23
33
3
oct. 23
788