Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
8443 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
2
juin 23
42183
1
juin 23
3416
1
août 20
8852
2
juin 20
3877
1
sept. 18
106