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.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客戶關係
- e-Commerce
- 會計
- 庫存
- PoS
- Project
- MRP
此問題已被標幟
1
回覆
8523
瀏覽次數
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
相關帖文 | 回覆 | 瀏覽次數 | 活動 | |
---|---|---|---|---|
|
2
6月 23
|
42323 | ||
|
1
6月 23
|
3526 | ||
|
1
8月 20
|
8921 | ||
|
2
6月 20
|
3976 | ||
|
1
9月 18
|
106 |