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
الرد
9819
أدوات العرض
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
يونيو 23
|
43763 | ||
|
|
1
يونيو 23
|
4889 | ||
|
|
1
أغسطس 20
|
10255 | ||
|
|
2
يونيو 20
|
5372 | ||
|
|
1
سبتمبر 18
|
106 |