Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
8645 Visninger

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
Kassér
Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
2
jun. 23
42512
1
jun. 23
3643
1
aug. 20
9064
2
jun. 20
4106
1
sep. 18
106