Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
12087 Ansichten

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
Verwerfen
Autor Beste Antwort

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
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Aug. 21
2622
1
Mai 22
2783
1
Jan. 23
1632
0
Sept. 21
1971
0
Juli 21
4778