English | Spanish
Odoo API XMLRPC Style
The module odoo_api allows you make REST API calls with a sintax similar to XMLRPC calls. The benefit of this is, you do not have to do a lot of development on the backend side. The downside of that is you still have to do a lot of coding, on the frontend side. Plus, you will need to know the inner workings of Odoo.
This module has no requirements for its installation. You only need to download it form the github repository and install it in your Odoo. Please, keep in mind that the dbfilter setting needs to be set to a database for the REST interface to work.
Check wiki: odoo_api wiki
- Documentation
POST /odoo-api/common/version
None
import requests
import json
url = 'http://localhost:8069/odoo-api/common/version'
data = {'params': {}}
headers = {'Content-type': 'application/json'}
r = requests.post(url, data=json.dumps(data), headers=headers)
print(r.text)
POST /odoo-api/common/login
Attribute | Type | Required | Description |
---|---|---|---|
db |
string | yes | Odoo server DB name |
login |
string | yes | Odoo User |
password |
string | yes | Odoo User Password |
POST /odoo-api/object/fields_get
Attribute | Type | Required | Description |
---|---|---|---|
model |
string | yes | Odoo model |
db |
string | yes | Odoo server DB name |
login |
string | yes | Odoo User |
password |
string | yes | Odoo User Password |
POST /odoo-api/object/search_count
Attribute | Type | Required | Description |
---|---|---|---|
model |
string | yes | Odoo model |
filters |
array | no | Odoo filter for records in search |
db |
string | yes | Odoo server DB name |
login |
string | yes | Odoo User |
password |
string | yes | Odoo User Password |
POST /odoo-api/object/search
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 |
POST /odoo-api/object/read
Attribute | Type | Required | Description |
---|---|---|---|
model |
string | yes | Odoo model |
ids |
number array | yes | Odoo number array of record IDS |
db |
string | yes | Odoo server DB name |
login |
string | yes | Odoo User |
password |
string | yes | Odoo User Password |
POST /odoo-api/object/search_read
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 |
POST /odoo-api/object/write
Attribute | Type | Required | Description |
---|---|---|---|
model |
string | yes | Odoo model |
id |
number | yes | Odoo record ID |
vals |
object | yes | Odoo object of values to write |
db |
string | yes | Odoo server DB name |
login |
string | yes | Odoo User |
password |
string | yes | Odoo User Password |
POST /odoo-api/object/create
Attribute | Type | Required | Description |
---|---|---|---|
model |
string | yes | Odoo model |
vals |
object | no | Odoo object of values to create on record |
db |
string | yes | Odoo server DB name |
login |
string | yes | Odoo User |
password |
string | yes | Odoo User Password |
POST /odoo-api/object/unlink
Attribute | Type | Required | Description |
---|---|---|---|
model |
string | yes | Odoo model |
id |
number | yes | Odoo record ID to delete |
db |
string | yes | Odoo server DB name |
login |
string | yes | Odoo User |
password |
string | yes | Odoo User Password |
Originally developed for Codize App
Developer: Ignacio Buioli <[email protected]>