I have tree models (Model1, Model2, Model3), how can I show one field from Model2 or Model3 in Model1 with a TypeModel in Model1 and only an ID in Model2 or Model3?
คำถามนี้ถูกตั้งค่าสถานะ
You have to connect the two models with one field over a many2one relation. Then you can automatically use any field of the connected model. As an example, check event.registration that contains the field event_id in a many2one relation with the precision that the model for event_id is event.event. This way, you can from within the event.registration access all fields of the corresponding event.
For more detail please check
https://www.odoo.com/documentation/15.0/developer/howtos/rdtraining/08_relations.html
Hope this helps.
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อ| Related Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
|---|---|---|---|---|
|
Reuse field from a different Model
แก้ไขแล้ว
|
|
1
มี.ค. 26
|
1773 | |
|
|
1
ก.ค. 25
|
3154 | ||
|
Search a message
แก้ไขแล้ว
|
|
1
ก.พ. 25
|
3126 | |
|
|
0
ธ.ค. 24
|
3390 | ||
|
Import Data From Another Model
แก้ไขแล้ว
|
|
1
มี.ค. 24
|
4745 |