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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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?
I think this piece of documentation will clear up a lot for you:
https://doc.odoo.com/trunk/server/03_module_dev_02/#relational-types
[EDIT]
If you only want specific data from the other object, add a domain to the field.
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.
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký