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
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1060
Views
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up