1.0.2 • Published 1 year ago

node-odoo-jsonrpc v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Node-Odoo-Jsonrpc

OdooRPC for node.js Inspired from odoo-connect and angular-odoo-jsonrpc

Installation

npm install --save node-odoo-jsonrpc

Functions list

  • login(db, user, pass)
  • logout(force)
  • getDbList()
  • searchRead(model, domain, fields, limit, offset, context)
  • call(model, method, args, kwargs)

How to use

Import Odoo

import { Odoo } from "node-odoo-jsonrpc";

Initialize configuration in constructor of component

const odooRPC = new Odoo();
odooRPC.init({
  odoo_server: "https://odoo-server-example",
  http_auth: "username:password", // optional
});
try {
  await odooRPC.login("db_example", "username", "password");
  console.log("login success");
} catch (err) {
  console.error("login failed", err);
}