Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dennybiasiolli/odoo-xmlrpc-client
Odoo xmlrpc client
https://github.com/dennybiasiolli/odoo-xmlrpc-client
client odoo xmlrpc xmlrpc-client
Last synced: 24 days ago
JSON representation
Odoo xmlrpc client
- Host: GitHub
- URL: https://github.com/dennybiasiolli/odoo-xmlrpc-client
- Owner: dennybiasiolli
- Created: 2020-06-16T14:07:19.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-25T19:40:24.000Z (over 2 years ago)
- Last Synced: 2024-10-20T14:31:58.302Z (27 days ago)
- Topics: client, odoo, xmlrpc, xmlrpc-client
- Language: TypeScript
- Homepage:
- Size: 193 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# Odoo xmlrpc client
See [CONTRIBUTING.md](CONTRIBUTING.md) to contribute to this project.
## Installation
```sh
$ npm install odoo-xmlrpc-client
```## Example
**Disclaimer**: please, refer to
[Odoo External API documentation](https://www.odoo.com/documentation/master/webservices/odoo.html)
for detailed usage of `odoo.executeKw` parameters.#### Connection configuration
```js
const { Odoo } = require('odoo-xmlrpc-client');const odoo = Odoo({
url: 'http://localhost', // odoo server url
// port: 8069, //
db: 'odoo', // database name
username: '', // odoo username
password: '', // odoo password
});
```#### Usage with promises
```js
odoo.authenticate().then(() => {
odoo.executeKw(
'res.partner',
'search',
[[['customer', '=', true]]],
{}
).then(ids => {
console.log('ids: ', ids);
odoo.executeKw(
'res.partner',
'read',
ids,
{ 'fields': ['name', 'country_id', 'comment', 'is_company', 'customer'] }
).then(res => {
console.log('Results: ', res);
})
});
})
```#### Usage with async/await
```js
await odoo.authenticate();
console.log('Connected to Odoo server.');
const ids = await odoo.executeKw(
'res.partner',
'search',
[[['customer', '=', true]]],
{}
);
console.log('ids: ', ids);
const res = await odoo.executeKw(
'res.partner',
'read',
ids,
{ 'fields': ['name', 'country_id', 'comment', 'is_company', 'customer'] }
);
console.log('Results: ', res);
```