İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
8527 Görünümler

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
Vazgeç
En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Haz 23
42325
1
Haz 23
3528
1
Ağu 20
8928
2
Haz 20
3981
1
Eyl 18
106