Skip to content

Odoo Delete

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

Description

Delete a record on model.

Endpoint

POST /odoo-api/object/unlink

Parameters

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

Examples

Python

import requests
import json

url = 'http://localhost:8069/odoo-api/object/unlink'
data = {'params': {'model': 'res.partner', 'id': 3, '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/unlink',
{params: {model: 'res.partner', id: 3, db: 'odoo', login: 'admin', password: 'admin'}}).subscribe(data => {
    console.log(data.result);
});
Clone this wiki locally