Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Odoo Search Read

Ignacio Buioli edited this page Jan 18, 2021 · 1 revision

Description

Search records by filter and get field data in just one request.

Endpoint

POST /odoo-api/object/search_read

Parameters

Attribute Type Required Description
model string yes Odoo model
filters array no Odoo filter for records in search
keys object no Odoo key arguments
db string yes Odoo server DB name
login string yes Odoo User
password string yes Odoo User Password

Examples

Python

import requests
import json

url = 'http://localhost:8069/odoo-api/object/search_read'
data = {'params': {'model': 'res.partner', 'filters': [('is_company', '=', True)], 'keys': {'fields': ['name'], 'limit': 5}, 'db': 'odoo', 'login': 'admin', 'password': 'admin'}}
headers = {'Content-type': 'application/json'}

r = requests.post(url, data=json.dumps(data), headers=headers)

print(r.text)

Angular

this.http.post<any>('http://localhost:8069/odoo-api/object/search_read',
{params: {model: 'res.partner', filters: [['is_company', '=', true]], keys: {fields: ['name'], limit: 5}, db: 'odoo', login: 'admin', password: 'admin'}}).subscribe(data => {
    console.log(data.result);
});
Clone this wiki locally
Morty Proxy This is a proxified and sanitized view of the page, visit original site.