odoo@1.0.0
- create(model, data, options)
- deleteRecord(model, recordId)
- read(model, recordId, fields)
- update(model, recordId, data)
This adaptor exports the following from common:
Functions
create
create(model, data, options) ⇒ Operation
Create a record in Odoo
Param | Type | Description |
---|---|---|
model | string | The specific record model i.e. "res.partner" |
data | object | The data to be created in JSON. |
options | object | Optional external ID for the record. |
Example
create("res.partner", { name: "Kool Keith" }, {externalId: 23});
deleteRecord
deleteRecord(model, recordId) ⇒ Operation
Delete a record from Odoo
Param | Type | Description |
---|---|---|
model | string | The specific record model i.e. "res.partner" |
recordId | number | The specific recordId to be deleted. |
Example
deleteRecord("res.partner", 54 );
read
read(model, recordId, fields) ⇒ Operation
Get a record from Odoo. Returns all fields unless a field list is provided as a third argument
Param | Type | Description |
---|---|---|
model | string | The specific record model from i.e. "res.partner" |
recordId | number | An array of record IDs to read. |
fields | string | An optional array of fields to read from the record. |
Example: Download records with select fields
read("res.partner", [1] , [name]);
Example: Download a single record with all fields
read("res.partner", $.recordIds);
update
update(model, recordId, data) ⇒ Operation
Update a record in Odoo
Param | Type | Description |
---|---|---|
model | string | The specific record model i.e. "res.partner" |
recordId | number | The specific recordId to be updated. |
data | object | The data to be updated in JSON. |
Example
update("res.partner", 54 , {name: 'Jane Doe'});