I want to ask about how to search data using rest API then show all its field relation. Now I just get [id and name] of its relation, I want to get all data from its relation not only id and name, for example I get data product, there is relation create user id, I want to get username, email and etc from user data. Thank you for anyone attention to my question.
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ờ
To get more data from related fields in the REST API, you can use the fields parameter in the API call. This parameter allows you to specify which fields you want to include in the response. For example, if you want to get the username field from the res.users model, you can use the following API call:
GET /api/users?fields=id,name,username
This will return a response with the id, name, and username fields for each user in the database. You can specify any fields you want in the fields parameter, separated by commas.
Keep in mind that not all fields are available in the REST API by default, and you may need to enable them in the ir.model.fields model before you can use them in the fields parameter. You can do this by setting the readonly attribute to False for the desired fields.
I hope this helps! Let me know if you have any other questions.
Take a look to fields_get() method here: https://www.odoo.com/documentation/15.0/es/developer/api/external_api.html#list-record-fields
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 | |
---|---|---|---|---|
|
1
thg 1 24
|
15149 | ||
|
1
thg 2 25
|
1423 | ||
|
3
thg 7 20
|
12929 | ||
|
0
thg 3 15
|
3910 | ||
|
2
thg 3 15
|
5576 |
Please help me!
I don't know