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.
Bu soru işaretlendi
1
Cevapla
10043
Görünümler
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
Tartışma hoşunuza mı gidiyor? Sadece okumakla kalmayın, katılın!
Özel özelliklerden yararlanmak ve harika topluluğumuzla etkileşime geçmek için bugün bir hesap oluşturun!
Üye Ol| İlgili Gönderiler | Cevaplar | Görünümler | Aktivite | |
|---|---|---|---|---|
|
|
2
Haz 23
|
44030 | ||
|
|
1
Haz 23
|
4997 | ||
|
|
1
Ağu 20
|
10393 | ||
|
|
2
Haz 20
|
5550 | ||
|
|
1
Eyl 18
|
106 |