Odoo Help


Display a record ?

on 3/13/13, 12:25 PM 1,470 views


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 ?


Daniel Reis

--Daniel Reis--
| 7 8 9
Linda-a-Velha, Portugal
--Daniel Reis--

Author of the "Odoo Development Essentials" book.

Applications Manager at Securitas Portugal

Github: https://github.com/dreispt

Twitter; @reis_pt

Daniel Reis
On 3/13/13, 2:57 PM

You can refer to the step by step guide for OpenERP custom web development in the official docs.

On 3/18/13, 11:39 AM

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.myWidget = openerp.web.form.Field.extend(

 start: function() {     


           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;          
                    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.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 3/13/13, 12:25 PM
Seen: 1470 times
Last updated: 3/16/15, 8:10 AM