Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
8546 Переглядів

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.

Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
черв. 23
42363
1
черв. 23
3553
1
серп. 20
8943
2
черв. 20
4021
1
вер. 18
106