Quickstart
This section helps you quickly get started with TheODXProxy by demonstrating a basic request to read data from the res.partner model using the read action.
POST /api/odoo/execute
Content-Type: application/json
Header: x-proxy-api:your-api-keyπ Example: Read res.partner Records
res.partner RecordsThis example demonstrates how to use the read action to retrieve specific fields from partner records in Odoo.
β
Request Body
{
"id": "read_res_partner_demo",
"action": "read",
"model_id": "res.partner",
"keyword": {
"limit": 10,
"fields": ["name", "email", "phone"],
"context": {
"allowed_company_ids": [1],
"default_company_id": 1,
"tz": "Asia/Jakarta"
}
},
"params": [
[1, 2, 3]
],
"odoo_instance": {
"url": "https://your-odoo-instance.com",
"user_id": 2,
"db": "your-database-name",
"api_key": "your-odoo-api-key"
}
}π Explanation
action:
"read"β fetches specific fields from existing records.model_id:
"res.partner"β refers to the Odoo model.keyword.fields: The fields you want to retrieve (
name,email,phone).params: A list of record IDs to read (
[1, 2, 3]).odoo_instance: Connection details to your Odoo server.
π’ Sample Response
If thereβs an error, the response will follow JSON-RPC 2.0 error format:
π΄ Sample Error Response
Last updated