Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
8428 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
2
Jun 23
42161
1
Jun 23
3404
1
Agu 20
8822
2
Jun 20
3858
1
Sep 18
106