Help

4

Is it possible to add radio button in openerp v7.0 .?.

Avatar
charlesraj

i created a module in openerp it have textbox, dropdown list etc for adding the student details. so iwant to add a radio button field to that form.

i just add the following line in python code.

'rd':fields.radio([('state','State'),('cbse','CBSE')],'Syllabus',required=True), 'rd':fields.radiobutton([('state','State'),('cbse','CBSE')],'Syllabus',required=True),

but in the first case in the form displays a dropdown list.

The line on the xml view is given below.

<field name="rd"/>

and also try this <field name="rd" widget="radio"/>

please give suggestion to me..

1 Comment
Avatar
Discard
5 Answers
2
Best Answer

Why don't u use one2many field or a selection and let them choose from a Dropdown list. This give the same functionality. Radiobuttons are not implemented so far as I know.

2 Comments
Avatar
Discard
Avatar
charlesraj
-

ok i will use the selection instead of it.. Thanks for your answer....

Avatar
Fransis L. Yoas
-

can i use selection widget for many value..example: I need 21 values that fit in one selection..is it possible?because I have tried other widget llike one2many but it can't solve my problem..I only can do with selection

2
Best Answer

There is no radio button widget in v7, but you can add it using widget="radio" attribute.

First you create your own widget [like selection widget] then add python code: 'syllabus': fields.selection([('state','State'),('cbse','CBSE')],'Syllabus'), and add XML code: <field name="syllabus" widget="radio"/>

The radio widget is available in trunk branch.

Avatar
Discard
1
Best Answer

In OpenERP the radiobutton function is simuleted by a selection field. If you need to choose only one value in between some values you can use selection, if you want select more values there are booleans fields. Why you need radiobutton?

4 Comments
Avatar
Discard
Avatar
charlesraj
-

ok i will use the selection insted of it .. Thanks for your reply..

If this answer is the correct one, please set it as correct with the green circle near the answer text. So, you can help future user with the some problem

Avatar
Andreas Maertens
-

All Answers are correct. ;)

Avatar
Fransis L. Yoas
-

can i use selection widget for many value..example: I need 21 values that fit in one selection..is it possible?because I have tried other widget..it can't solve my problem..I only can do with selection

1
Best Answer

There is no radio button widget in v7, only drop down widget for both selection and many2one fields. However, in v8, there will be a new radio button widget that can be used in view using widget="radio" attribute.

The new radio widget is available now in trunk branch but there is no estimated release date yet for v8. I think it will be somewhere in 2014.

Avatar
Discard
0
Avatar
Mohammed Mansour
Best Answer

You can see this link where you can use it to make a radio button widget in openerp.

http://stackoverflow.com/questions/22612080/openerp-view-change-look-of-selection-field-aka-radio-button

if you want the module for free, kindly send your email to me at (engmohamans@gmail.com) .

 

 

 

Avatar
Discard