1.2.0 • Published 2 years ago

svg-odoo v1.2.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

SVG-ODOO

Libreria para simplificar la conexión con odoo sobre JSONRPC.

USO

import { SvgOdoo } from 'svg-odoo';

const connection = SvgOdoo.getIntance({
  username: 'Administrador',
  password: 'administrador',
  port: 8069,
  host: 'http://localhost',
  baseUrl: 'jsonrpc',
  version: '2.0',
  database: 'test'
});
 connection.login()

Get all items

console.log(await connection.request({
      action: MethodsTypes.GET,
      model: 'hr.employee',
      columns: ['name', 'job_title', 'type_employee']
    }));

Get single item

    // Get single Item
    console.log(await connection.request({
      action: MethodsTypes.GET,
      model: 'res.country',
      columns: ['name', 'code'],
      id: 259
    }));

Create new item

    // Create New Item
    console.log(await connection.request({
      action: MethodsTypes.POST,
      model: 'res.country',
      payload: {
        name: 'OTRO PAIS',
        code: 'ZZZ'
      }
    }));

Update single item

    // Actualizar Item
    console.log(await connection.request({
      action: MethodsTypes.PUT,
      model: 'res.country',
      id: 259,
      payload: {
        name: 'UN PAIS MAS',
        code: 'XX'
      }
    }));

Delete single item

    // Eliminar Item
    console.log(await connection.request({
      action: MethodsTypes.DELETE,
      model: 'res.country',
      id: 259
    }));

Emit Action

1.2.0

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

3 years ago