Hello
I am developing a web module in OpenERP 6.1 I want to display this record, so I would be able to use it with JQuery.
How can I do that simple thing ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello
I am developing a web module in OpenERP 6.1 I want to display this record, so I would be able to use it with JQuery.
How can I do that simple thing ?
You can refer to the step by step guide for OpenERP custom web development in the official docs.
I finally find how to display a record, and that is NOT in the OpenERP documentation ! Here is a simple function Javascript :
openerp.test = function(openerp) {
openerp.web.form.widgets.add('myWidget','openerp.web.form.myWidget');
openerp.web.form.myWidget = openerp.web.form.Field.extend(
{
start: function() {
this.Read());
},
Read: function() {
console.log('start to read');
var self = this.view;
this.rpc('/web/dataset/search_read', {
model: this.view.model,
fields: fields || false,
domain: this.view.domain,
context: this.view.context,
offset: 0,
limit: false
}).pipe(function (result) {
self.ids = result.ids;
self._length = result.length;
console.log(result);
return result.records; // Records is the table of the module
});
console.log('finished to read');
},
}
Then you can access the data :
console.log(result.records); //display all the records
console.log(result.records[id]); //display all column of record #id
console.log(result.records[id]['column']); //display column 'column' of record #id
Then you can just save it in a variable and use it with JQuery in your QWeb file.
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 6 24
|
4208 | ||
Domain one2many field?
Đã xử lý
|
|
5
thg 6 23
|
35738 | |
|
1
thg 12 23
|
19495 | ||
|
1
thg 7 15
|
6147 | ||
|
2
thg 3 15
|
6413 |