Coder Social home page Coder Social logo

odoo-webkit's Introduction

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: '[email protected]' }).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);

odoo-webkit's People

Contributors

hostelix avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.