Skip to Content
मेन्यू
This question has been flagged
1 Reply
8699 Views

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
Discard
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
Discard
Related Posts Replies Views Activity
2
जून 23
42573
1
जून 23
3709
1
अग॰ 20
9105
2
जून 20
4168
1
सित॰ 18
106