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.
Це запитання позначене
1
Відповісти
11295
Переглядів
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
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Реєстрація| Related Posts | Відповіді | Переглядів | Дія | |
|---|---|---|---|---|
|
|
2
черв. 23
|
45152 | ||
|
|
1
черв. 23
|
5670 | ||
|
Get data from JS file to XML file
Вирішено
|
|
1
серп. 20
|
11222 | |
|
|
2
черв. 20
|
6448 | ||
|
|
1
вер. 18
|
106 |