Community mailing list archives

Re: About JSON-RPC in odoo

- 05/07/2015 07:46:43
Hi andré,
thank you a lot for your answer. I'll try that library. I also found this one wich uses also javascript.
Our apps are android native, so we need to connect to Odoo using android-jsonrpc.3.4 library.

best regards

SSLL, Intégrateur Odoo.
Intégration de Services.
BI and IT consulting.
tél  0661360233 - 0636898882
fax 0528215738

On Wed, May 6, 2015 at 5:08 PM, André P. <> wrote:
No docs as far as I know, but I've had success using this library:

Here's a small example:

            login = new $.JsonRpcClient({ ajaxUrl: '' });
  'call', {"base_location": "",
                                "db": "mydatabase",
                                "login": "admin",
                                "password": "admin",
                                "context": {}}, function(data) {
                                       client = new $.JsonRpcClient({ ajaxUrl: '' });
                             'call', {"context": {},
                                                            "model": "res.partner",
                                                            "method": "create",
                                                            "args": [{"name": "John",
                                                                      "email": ""}],
                                                            "kwargs": {"context": {}},
                                                            "session_id": data.session_id}, function(done) {
                                                                 console.log("Partner created");

This code logs in to the database, then creates a new res.partner and finally sends a message to the log confirming the creation.

Beware that if you need to run this code outside the same domain as the Odoo instance, you need to set up the CORS headers ( We use Nginx as a reverse proxy to Odoo, so we configured it to add the headers on the replies.

2015-05-06 13:03 GMT+01:00 zahid jalal <>:
Hi every one

We have devlopped many Odoo/openerp mobile/webapp clients using the XMLRPC webservice. Now we are trynig to rewrite some of them to use JSON-RPC . But we are confronted to the lack of documentation about JSON-RPC in odoo.
This page was not of a great help. it does not not provide any information about urls to use for different call requests, nor the way to use session trough many json call.

Is there any source of some extensive documentation abour JSON-RPC in Odoo ?



Post to:


André Paramés



Avenida das Túlipas,

nº 6, 13º A/B 

1495-161 Algés

t.   +351 808 455 255



Rua do Espinheiro,

nº 641, 2 SALA 2.3 

4400-450 V.N. Gaia

Post to: