Odoo Help


how to add values dynamically in selection fields?

Demirel yakito
on 1/13/15, 1:45 AM 2,510 views

In default i have some fields in selection field. if i want to add another field in selection field. then how to add it?


Anil R. Kesariya

--Anil R. Kesariya--
| 6 5 8
Gandhinagar, India
--Anil R. Kesariya--
ERP Consultant

Key Skill
Technical & Functional Expert
Anil R. Kesariya
On 1/13/15, 2:36 AM

Hello Ramanan,

The same Question is asked

Nice answer given by Atul.

Click Here

Click above link for your answer.




Dhinesh - Technical Consultant, Sodexis Inc

--Dhinesh - Technical Consultant, Sodexis Inc--
Dhinesh - Technical Consultant, Sodexis Inc
| 5 4 9
Pondicherry, India
--Dhinesh - Technical Consultant, Sodexis Inc--

Passionate coder in Python/OpenERP. Knows Django/Flask MVC frameworks. Did code in Java, PHP.

Contact me at: dvdhinesh.mail@gmail.com

Dhinesh - Technical Consultant, Sodexis Inc
On 1/13/15, 2:14 AM

Go through this link:


If your selection field is static list of tuples defined in field, then there is no way to do. If it is a method or global variable you can change it.


you can use list to add item dynamically in fields.Selection 
for i in range(1900,2017):

class Employee(models.Model):
      _name = 'employee.details'
      year=fields.Selection(list1, string='Years', required=True, copy=True)

     #append item


    #update item


     #item updated automatically in field.Selection

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


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 1/13/15, 1:45 AM
Seen: 2510 times
Last updated: 1/24/17, 9:46 AM