Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
8500 Vistas

I am trying to display field values when button is clicked. This button is not linked to any module.It is in the navigation bar just beside the conversations. How can i get the field values from a particular module on button click.

Avatar
Descartar
Mejor respuesta

Your JS code should look like this:

var model = require('web.DataModel');

$('#my-button').click(function() {
     new Model('addon.model').query(['name'])
.filter([['id', '=', 1]])
.first()
.then(function(res) {
      console.log(res);
});
}); 

Check out the docs for more info: https://www.odoo.com/documentation/10.0/reference/javascript.html#high-level-api-calling-into-odoo-models

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
jun 23
42273
1
jun 23
3505
1
ago 20
8905
2
jun 20
3952
1
sept 18
106