Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
8687 Prikazi

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
Opusti
Best Answer

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
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
jun. 23
42565
1
jun. 23
3705
1
avg. 20
9093
2
jun. 20
4161
1
sep. 18
106