Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
8450 Visualizzazioni

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
Abbandona
Autore

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

Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
dic 19
2999
2
dic 23
14177
0
nov 23
1366
0
ott 23
33
3
ott 23
788