Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

4

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

By
charlesraj
on 6/6/13, 6:46 AM 4,631 views

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

2

Andreas Maertens

--Andreas Maertens--
912
| 5 5 7
Finsterwalde, Germany
--Andreas Maertens--

I develop odoo8.0 modules

Andreas Maertens
On 6/6/13, 7:21 AM

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.

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

charlesraj
on 6/6/13, 7:49 AM

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

Fransis L. Yoas
on 7/9/13, 5:54 AM
2

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.

1

Mohammad Alhashash

--Mohammad Alhashash--
2075
| 5 5 8
Giza, Egypt
--Mohammad Alhashash--

Developer

Mohammad Alhashash
On 6/6/13, 8:21 AM

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.

1

Francesco OpenCode

--Francesco OpenCode--
3608
| 5 7 9
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode
On 6/6/13, 7:26 AM

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?

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

charlesraj
on 6/6/13, 7:48 AM

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

Francesco OpenCode
on 6/6/13, 7:56 AM

All Answers are correct. ;)

Andreas Maertens
on 6/6/13, 11:06 AM

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

Fransis L. Yoas
on 7/9/13, 5:49 AM
0
Mohammed Mansour
On 1/28/15, 2:22 AM

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

 

 

 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/6/13, 6:46 AM
Seen: 4631 times
Last updated: 3/16/15, 8:10 AM