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.

0

Cannot connect to Odoo using XMLRPC

By
Merlin TecSol Pvt. Ltd.
on 1/4/16, 2:48 AM 950 views

Hello,

I am using follwoing code in a python script to connect to my Odoo server

import xmlrpclib
svr, db = 'http://176.9.114.168:8069', 'school_erp'
user, pwd = 'xxxxx','xxxxx123'
info = xmlrpclib.ServerProxy('%s/xmlrpc/2/common' % svr)

But it is not getting connected and showing this error:

xmlrpclib.Fault: <Fault 1: 'Traceback (most recent call last):\n  File "/opt/odoo/server/openerp/service/wsgi_server.py", line 75, in xmlrpc_return\n    
result= openerp.http.dispatch_rpc(service, method, params)\n  File "/opt/odoo/server/openerp/http.py", line 115, in dispatch_rpc\n    result = dispatch(method,params)\n 
File "/opt/odoo/server/openerp/service/common.py", line 23, in dispatch\n
raise Exception("Method not found: %s" % method)\nException: Method not found: __getitem__\n'>xmlrpclib.Fault: 
 



What mistake am I making here?

TIA

Yogesh

3

Jusab Sida (jsi)

--Jusab Sida (jsi)--
Tiny ERP Pvt Ltd
http://www.odoo.com
874
| 2 1 5
Gandhinagar, India
--Jusab Sida (jsi)--


Jusab Sida (jsi)
On 1/4/16, 7:51 AM

Hello Yogesh,

I have also done this thing and it's work fine.you can take it as reference.

import xmlrpclib

HOST = "abc.abc" # Host url name
DB = "my-db" # Name of the database
USER = "my_user@abc.abc" # User Name to login database
PASS = "mypassword" # Password to login database
url = 'http://%s/xmlrpc/' % (HOST)
common_proxy = xmlrpclib.ServerProxy(url+'common')
object_proxy = xmlrpclib.ServerProxy(url+'object')

uid = common_proxy.login(DB,USER,PASS)
print "Logged in as %s (uid:%d)" % (USER, uid)


Hope this will help you to solve your problem,


Thank you very much. You have got me started.

Merlin TecSol Pvt. Ltd., Merlin TecSol Pvt. Ltd.
on 1/5/16, 1:11 AM

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: 1/4/16, 2:48 AM
Seen: 950 times
Last updated: 1/5/16, 1:10 AM