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
ตอบกลับ
11294
มุมมอง
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
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อ| Related Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
|---|---|---|---|---|
|
|
2
มิ.ย. 23
|
45150 | ||
|
|
1
มิ.ย. 23
|
5670 | ||
|
Get data from JS file to XML file
แก้ไขแล้ว
|
|
1
ส.ค. 20
|
11221 | |
|
|
2
มิ.ย. 20
|
6444 | ||
|
|
1
ก.ย. 18
|
106 |