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.
Deze vraag is gerapporteerd
1
Beantwoorden
9837
Weergaven
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
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
Aanmelden| Gerelateerde posts | Antwoorden | Weergaven | Activiteit | |
|---|---|---|---|---|
|
|
2
jun. 23
|
43769 | ||
|
|
1
jun. 23
|
4891 | ||
|
Get data from JS file to XML file
Opgelost
|
|
1
aug. 20
|
10261 | |
|
|
2
jun. 20
|
5377 | ||
|
|
1
sep. 18
|
106 |