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.
Tämä kysymys on merkitty
1
Vastaa
9817
Näkymä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
Nautitko keskustelusta? Älä vain lue, vaan osallistu!
Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!
Rekisteröidy| Aiheeseen liittyviä artikkeleita | Vastaukset | Näkymät | Toimenpide | |
|---|---|---|---|---|
|
|
2
kesäk. 23
|
43763 | ||
|
|
1
kesäk. 23
|
4889 | ||
|
Get data from JS file to XML file
Ratkaistu
|
|
1
elok. 20
|
10255 | |
|
|
2
kesäk. 20
|
5372 | ||
|
|
1
syysk. 18
|
106 |