Odoo Help


How do I create a selection field?

sanaa tayb
on 5/12/13, 8:38 PM 2,372 views

hello everyone ... I created a new module called : infos_admin where I have a registration form with a bunch of fields to register a new patient in my database , the problem is I created another module where I need to get all the patient names so select one...

Any idea how to realise this?

Provide more details so we can help you. what exactly you mean by 'get all the patients names'? do you want to let the user to select one? or show a table containing all patient records? and what you want to be able to do with them?

Smart Way Business Solutions, Anas Taji
on 5/13/13, 1:09 AM

i want to create a "drop down list" containing the list of all my patient's names, and let the user select one of them ... do you see what i mean?? thanks for your reply :)

sanaa tayb
on 5/13/13, 5:53 PM

Anas Taji

--Anas Taji--
| 6 7 8
Amman, Jordan
--Anas Taji--

Skype: anas.taji-sw

Email: anas.taji@smartway-jo.com

Anas Taji
On 5/13/13, 9:15 PM

In your second module class, add the following field:

_column = { ...
          'patient_id': field.many2one('patient.object', 'Patient')

In the second module form view, add the field like below:

<field name="patient_id" widget="selection" string="Patient"/>

Hope this will help you..%

Thank you very very much , it did woork :)

sanaa tayb
on 5/14/13, 1:22 PM

Glad to hear it, you may want to mark the question as solved.. ;)

Smart Way Business Solutions, Anas Taji
on 5/14/13, 4:19 PM
Francisco Castro
On 3/3/14, 2:41 PM

how can I use that selection type to list some items of the choice I made for example the age, the color of the hair, etc on another field?

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

2 follower(s)


Asked: 5/12/13, 8:38 PM
Seen: 2372 times
Last updated: 3/16/15, 8:10 AM