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.

0

Number of options in radio button declaration will depend on a variable

By
Lakay lakay
on 10/7/14, 2:46 AM 555 views

Hi, I have a question   (im using Odoo v9.0 alpha)

ive added a field in 'res_users' by override:

python code:

class res_users(osv.osv):

        _name='res.users'
        _inherit='res.users'
        _columns={

                'testing:fields.selection([('testing1','Testing1'),('testing2','Testing2')],'Testing'),

}
res_users()

xml code: ive added this line

<field name="testing" widget="radio"/>

So we are able to display a 2 radio button like this

o Testing1                                Option 1

Testing2                                Option 2

is it possible to generate (n) number of options for my radio button (earlier there are only 2 options) now i want  for example, the number of records in my customize module is 4 how will i edit my definition here so it will be depending on the number of records of my customize module       'testing:fields.selection([('testing1','Testing1'),('testing2','Testing2')],'Testing'),

 

 

 

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: 10/7/14, 2:46 AM
Seen: 555 times
Last updated: 3/16/15, 8:10 AM