odoo-node-sdk
v1.0.2
Published
Mini Odoo SDK written in Node.js using JSON RPC.
Downloads
2
Readme
Odoo Node SDK
Documentation
Odoo Authentication
const { Odoo } = require("odoo-node-sdk");
const odoo = new Odoo({
username,
password,
database,
host,
port,
uri,
});
(async () => {
await odoo.authenticate();
})();
Search
const products = await odoo.search({
model: "product.product",
domain: [],
fields: ["name"],
});
console.log(products);
// [{id: 1, name: "Product 1"}, {id: 2, name: "Product 2"}]
Create
const product = await odoo.create({
model: "product.product",
{ name: "My new product" }
});
console.log(product);
// [3]
Write
const product = await odoo.write({
model: "product.product",
3, { name: "My new product updated!" }
});
console.log(product);
// true
Unlink
await odoo.unlink({ model: "product.product", 3 });