Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
8549 Visualizações

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
Cancelar
Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
2
jun. 23
42369
1
jun. 23
3555
1
ago. 20
8950
2
jun. 20
4023
1
set. 18
106