What is the clever way to get fields of related records using the extract API? I was under the impression I can use the dot separator to get the fields. Probably I brought that from working with ServiceNow. I ran into errors when I tried to do that. I read the docs and I do not know what to do now. I can always make multiple subsequent queries to get the fields of the related records based on the IDs but I'd like to avoid that. Thinking about adding a computed field that returns the value of the field of the related model, but I think that would create extra database calls in Odoo. A bit better, but still seems a waste of resources. Do I need to create a custom function where I query the database with join? What would you do?
To be more concrete, I want to get certain fields od res_partner when I query mail.message. Tried author_id.fields, but that throws error saying that author_id.field is not a field of mail.message.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
1434
Lượt xem
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ý