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?
Câu hỏi này đã bị gắn cờ
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.
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
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ý| Bài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
|---|---|---|---|---|
|
Reuse field from a different Model
Đã xử lý
|
|
1
thg 3 26
|
1739 | |
|
|
1
thg 7 25
|
3094 | ||
|
Search a message
Đã xử lý
|
|
1
thg 2 25
|
3076 | |
|
|
0
thg 12 24
|
3348 | ||
|
Import Data From Another Model
Đã xử lý
|
|
1
thg 3 24
|
4724 |