Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
11187 มุมมอง

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?

ผู้เขียน

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 :)

คำตอบที่ดีที่สุด

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 :)

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

คำตอบที่ดีที่สุด

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?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มี.ค. 15
8640
5
ม.ค. 24
16178
4
มี.ค. 15
5969
1
มี.ค. 15
7652
0
มี.ค. 15
3661