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

Dynamic selection field

By
soumaya
on 4/27/16, 6:14 AM 420 views

How can i define a dynamic selection field where the user can add new items that are not predefined this code define a static selection field:

score:field.selection([('key1','value1').....],string='score'),

0
Jose Vasquez
On 4/27/16, 11:14 AM

Hi, try this:

def _dinamic_selection(self):
    list_field = []
    # add elementos to list
    return list_field


_columns = {
    'field_selecction' : fields.selection('_dinamic_selection', 'Dinamic Field Selection'),
}


I hope you help, regards.

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: 4/27/16, 6:14 AM
Seen: 420 times
Last updated: 4/27/16, 11:14 AM