Odoo Help

Welcome!

This community 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.

2

XMLRPC with JavaScript V7

By
xiaolong97427
on 4/4/13, 3:09 AM 2,148 views

I am building a mobile webapp and need to pull and push data to OpenERP V7.

If I understood the only way to communicate with OpenERP is XML-RPC or JSON-RPC.

Questions: 1/ I found document with XMLRPC but not for JSON. Any idea where I can get it ? 2/ Testing XMLRPC with Javascript and jquery.xmlrpc.js

I wrote :

  $.xmlrpc({
    url: 'http://mySErverName:8069/xmlrpc/common',
    methodName: 'login',
    params: ['myDb', 'admin', 'password'],
    success: function(response, status, jqXHR) { alert('OK')},
    error: function(jqXHR, status, error) { alert('Error : ' + error.debug ) }
    });

But when executing, function error is executed but error has no value inside. So I don't what's wrong.

What is the best way to use xmlrpc with Javascript ? What is wrong with the code I posted ?

Regards, St.

0
Mind And Go
On 5/8/15, 4:39 PM

Hi,

if you're running on Odoo v8, try ti use the xmlrpc/2 API : https://www.odoo.com/documentation/8.0/api_integration.html

Additionnaly, have a look to server logs, it could be useful.

regards

0
Gustavo Seluja
On 5/8/15, 4:32 PM

Had you got any answer about this? I have a very similar problem and can't get the solution. I need to invoke a webservice in Odoo from an html page with javascript, jquery or whatever. As I'm a nut in JS and JQuery, I copy your code and tried to invoke the login method but I got an error (inside the catch section of my code). Do you have any clue about this?

Thanks

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 4/4/13, 3:09 AM
Seen: 2148 times
Last updated: 5/8/15, 4:39 PM