1.6.0 • Published 5 years ago

odoo-webkit v1.6.0

Weekly downloads
15
License
MIT
Repository
github
Last release
5 years ago

odoo-webkit Build Status

Tools for development in web for odoo

Installing

Using npm:

$ npm install odoo-webkit

Using yarn:

$ yarn add odoo-webkit

Example

import { Model } from 'odoo-webkit';

const ResUsers = new Model('res.users');

//Create new user
ResUsers.create({ name: 'testing' }).then(console.log);

//Search users
ResUsers.filter(['email', 'ilike', '@odoo.com']).get().then(console.log);

//Update user
ResUsers.write([1], { email: 'testing@odoo.com' }).then(console.log);

//Delete user
ResUsers.unlink([1]).then(console.log);

odoo-webkit API

Usage class Model

import { Model } from 'odoo-webkit';

const task = new Model('todo.task');

// Method create ERP
task.create({ name: "test", is_done: false }).then(console.log);

// Method write ERP
task.write(1, { is_done: true }).then(console.log);

// Method unlink ERP
task.unlink(1).then(console.log);

//Search
task.filter(['is_done', '=', true]).get().then(console.log);

//Search and get especifict fields
task
  .fields(['name'])
  .filter(['is_done','=', false])
  .get()
  .then(console.log);

//Search all
task.all().then(console.log);

//Search and order
task
    .filter(['name','ilike','test'])
    .order_by('-id')
    .get()
    .then(console.log);

//count task
task.count();

//Search and limit
task
    .filter(['name','ilike','test2'])
    .order_by('name')
    .limit(100)
    .get()
    .then(console.log);

//How call function in ERP
task
    .call_button('_toggle_tasks', [data, context])
    .then(console.log)

Usage class Auth

import { Auth } from 'odoo-webkit';

const auth = new Auth();

// Method login
// parameters username, password, database
auth.login('admin', 'admin', 'test').then(console.log);

// Method logout
auth.logout().then(console.log);
1.6.0

5 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.8

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago