Odoo JSON-RPC client
npm install odoo-api> Odoo JSON-RPC client
This is a fork of odoo-connect with new added methods (read/count/readGroup) & HTTPS support.
```
$ npm install --save odoo-api
`js
const Odoo = require('odoo-api');
const odoo = new Odoo({
host: 'foobar.com',
port: 9999
});
odoo
.connect({
database: 'unicorn',
username: 'foo',
password: 'bar'
})
.then(client => {
return client.searchRead('product.product', [['list_price', '>', '50']], {limit: 1});
})
.then(products => {
console.log(products);
//=> [{list_price: 52, name: 'Unicorn'}]
});
`
#### options
Any of the connect options and the following options.
##### host
Type: string
Host of the Odoo server.
##### port
Type: number80
Default:
Port of the Odoo service.
Returns a Promise for a client object.
#### options
##### database
Type: string
Name of the database.
##### username
Type: string
Username to connect with.
##### password
Type: string
Password to connect with.
#### model
Type: string
Model to perform the action on.
#### args
Type: Array
List of parameters.
#### groupBy
Type: Array
Fields to group by.
#### params
Type: Object with properties:
##### offset
Type: number0
Default:
Result offset.
##### limit
Type: number5
Default:
Maximum number of results.
##### order
Type: stringid
Default:
Name of the fields used to sort the results.
##### select
Type: string[]
Fields that should be selected.
#### model
Type: string
Model to perform the action on.
#### args
Type: Array
List of parameters.
#### model
Type: string
Model to perform the action on.
#### args
Type: Array
List of parameters.
#### params
Type: Object with properties:
##### offset
Type: number0
Default:
Result offset.
##### limit
Type: number5
Default:
Maximum number of results.
##### order
Type: stringid
Default:
Name of the fields used to sort the results.
##### select
Type: string[]
Fields that should be selected.
#### model
Type: string
Model to perform the action on.
#### args
Type: Array
List of parameters.
#### model
Type: string
Model to perform the action on.
#### args
Type: Array
List of parameters.
#### params
##### offset
Type: number0
Default:
Result offset.
##### limit
Type: number5
Default:
Maximum number of results.
##### order
Type: stringid
Default:
Name of the fields used to sort the results.
##### select
Type: string[]
Fields that should be selected.
#### model
Type: string
Model to perform the action on.
#### args
Type: Array
List of parameters.
#### model
Type: string
Model to perform the action on.
#### method
Type: string
Odoo RPC method.
#### args
Type: Array
List of parameters.
#### params
Type: Object
Custom kwargs` properties.
MIT ©