Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use web-services in OpenERP/Odoo?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 162
    Comment on it

    If you want to use WebServices in OpenERP(Odoo) follow the below mentioned code and paste it in your WebServices XML-RPC file:

    1. import xmlrpclib
    2. define HOST, PORT, DB, USER, PASS
    3. url = 'http://%s:%d/xmlrpc/common' % (HOST,PORT)
    4. sock = xmlrpclib.ServerProxy(url)
    5. uid = sock.login(DB,USER,PASS)
    6. print "Logged in as %s (uid:%d)" % (USER,uid)
    7. Create a new idea
    8. url = 'http://%s:%d/xmlrpc/object' % (HOST,PORT)
    9. sock = xmlrpclib.ServerProxy(url)
    10. args = {
    11. 'name' : 'Another idea',
    12. 'description' : 'This is another idea of mine',
    13. 'inventor_id': uid,
    14. }
    15. idea_id = sock.execute(DB,uid,PASS,'idea.idea','create',args)

    Note-> OpenERP is accessible through XML-RPC interfaces, for which libraries exist in many languages

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: