0.1.1 • Published 9 months ago

odoo-xmlrpc-client v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

License Version

Odoo XML-RPC Client

This project provides a TypeScript client for interacting with Odoo's XML-RPC API. It allows you to authenticate and execute various methods on Odoo models.

Table of Contents

Installation

To install the package, use your favorite package manager. For example, with npm:

npm i odoo-xmlrpc-client

Usage

Here's an example of how to use the Odoo XML-RPC client:

import { OdooXMLRPC, OdooConfig } from 'odoo-xmlrpc-client';

const config: OdooConfig = {
    url: 'https://your-odoo-instance.com',
    db: 'your-database',
    username: 'your-username',
    password: 'your-password',
};

const odoo = new OdooXMLRPC(config);

async function main() {
    try {
        const uid = await odoo.authenticate();
        console.log('Authenticated with UID:', uid);

        const result = await odoo.execute_kw(
            'res.partner',
            'search_read',
            [[['is_company', '=', true]]],
            { fields: ['name', 'country_id', 'comment'], limit: 5 },
        );
        console.log('Result:', result);
    } catch (error) {
        console.error('Error:', error);
    }
}

main();

License

This project is licensed under the MIT License - see the LICENSE file for details.

0.1.0

10 months ago

0.1.1

9 months ago

1.0.0

5 years ago