Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
12121 Visninger

please help for External API, i am following guide lines from here:

https://www.odoo.com/documentation/14.0/webservices/odoo.html

wrote the .py file as below:

url = "127.0.0.1:8069"
db = 'odb14'
username = 'admin'
password = 'admin'
import xmlrpc.client
common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))
version = common.version()
print("details....", version)

when run it returns OSError: unsupported XML-RPC protocol ( my OS is Ubuntu 18.05 )

odoo@ubuntu:~/odoo-dev/odoo$ python3.6 -m odoo_webservice
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/odoo/odoo-dev/odoo/odoo_webservice.py", line 8, in <module>
    common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))
  File "/usr/lib/python3.6/xmlrpc/client.py", line 1418, in __init__
    raise OSError("unsupported XML-RPC protocol")
OSError: unsupported XML-RPC protocol

Avatar
Kassér
Forfatter Bedste svar

solved, the code below works fine, thanks to Daniel Ries author of Odoo Development Cookbook 

url = 'http://localhost:8069'
db = 'odb14'
username = 'admin'
password = 'admin'
import xmlrpc.client

common = xmlrpc.client.ServerProxy('%s/xmlrpc/2/common' % url)
version = common.version()
print("details...", version)
Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
0
aug. 21
2648
1
maj 22
2810
1
jan. 23
1666
0
sep. 21
1990
0
jul. 21
4792