Odoo Help


How to do web RPC requests in javascript?

on 6/28/13, 1:39 PM 3,880 views

Hi, I search how to interact with openerp database in javascript. I've found this example on the API documentation but it's don't works.

    var Users = new openerp.web.Model('res.users');
    Users.query(['name', 'login', 'user_email', 'signature'])
         .filter([['active', '=', true], ['company_id', '=', main_company]])
         .all().then(function (users) {
        // do work with users records

The error:

Object [object Object] has no method 'query'

Do you know why?

Thanks in advance for your help.


Thierry Godin

--Thierry Godin--
| 8 7 8
Collegien, France
--Thierry Godin--


Thierry Godin
On 7/31/14, 4:55 AM
On 7/31/14, 4:32 AM

Where you coding their should be 'openerp' as function parameter in top line of file. or 'instance' as parameter

new openerp.web.Model('res.users');

or new instance.web.Model('res.users');

So which once used try that one.  I double check and its working.



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: 6/28/13, 1:39 PM
Seen: 3880 times
Last updated: 3/16/15, 8:10 AM