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:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
1436
มุมมอง
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อ