-
Notifications
You must be signed in to change notification settings - Fork 32
Odoo Create
Ignacio Buioli edited this page Jan 26, 2021
·
1 revision
Create a new record on model.
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 |
import requests
import json
url = 'http://localhost:8069/odoo-api/object/create'
data = {'params': {'model': 'res.partner', 'vals': {'name': 'New Name'}, 'db': 'odoo', 'login': 'admin', 'password': 'admin'}}
headers = {'Content-type': 'application/json'}
r = requests.post(url, data=json.dumps(data), headers=headers)
print(r.text)
this.http.post<any>('http://localhost:8069/odoo-api/object/create',
{params: {model: 'res.partner', vals: {name: 'New name'}, db: 'odoo', login: 'admin', password: 'admin'}}).subscribe(data => {
console.log(data.result);
});