Odoo Help


How to use many2one to get value?

willie ho
on 10/20/14, 4:19 AM 764 views

I am creating a module and I want to use many2one field to many a selection field.

How can I control whcih column to get from other table?


Ludo - 21South

--Ludo - 21South--
| 2 2 5
Zwijndrecht, Netherlands
--Ludo - 21South--


Ludo - 21South
On 10/20/14, 5:27 AM

I think this piece of documentation will clear up a lot for you:



If you only want specific data from the other object, add a domain to the field.




| 5 3 6
Jakarta, Indonesia
On 10/20/14, 7:35 AM

Willie, if I understand you correctly you want to understand where the Value that is used for many2one field is taken from.

Technically it is taken from an ORM method called _name_get which will return a list of tuple pairs containing the database ID and the value to display.  Now, if you don't change anything on the _name_get method, the default is that it will display whatever is in the column named "name" or (if any) column specified in the _rec_name attribute of the ORM.

Hope this help.

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: 10/20/14, 4:19 AM
Seen: 764 times
Last updated: 3/16/15, 8:10 AM