Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3b51a20

Browse files
committedApr 15, 2025·
Merge branch '18.0' into 18.0-voip-use-case-sales-juma
2 parents 745a754 + b48cae4 commit 3b51a20

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+4604
-2025
lines changed
 

‎content/administration/odoo_online.rst

+54
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ database name. It is only displayed if an upgrade is available.
3636
- :ref:`odoo_online/delete`
3737
- :ref:`odoo_online/contact-support`
3838
- :ref:`odoo_online/users`
39+
- :ref:`odoo_online/web-services`
3940

4041
.. _odoo_online/upgrade:
4142

@@ -149,3 +150,56 @@ To remove users, select them and click :guilabel:`Remove`.
149150
.. seealso::
150151
- :doc:`/applications/general/users`
151152
- :doc:`odoo_accounts`
153+
154+
.. _odoo_online/web-services:
155+
156+
Web Services
157+
============
158+
159+
In order to programmatically retrieve the list of the databases displayed in the
160+
`database manager <https://www.odoo.com/my/databases>`_, call the method `list` of the model
161+
`odoo.database` via a :doc:`Web Service </developer/howtos/web_services>` call.
162+
163+
Inspired from the examples provided in the :doc:`Web Services </developer/howtos/web_services>`
164+
section, this is how to retrieve this list with the library ``xmlrpc.client``::
165+
166+
import xmlrpc.client
167+
168+
USER = 'user@domain.tld'
169+
APIKEY = 'your_apikey'
170+
171+
root = 'https://www.odoo.com/xmlrpc/'
172+
uid = xmlrpc.client.ServerProxy(root + 'common').login('openerp', USER, APIKEY)
173+
sock = xmlrpc.client.ServerProxy(root + 'object')
174+
databases_list = sock.execute('openerp', uid, APIKEY, 'odoo.database', 'list')
175+
176+
And here is the equivalent example with JSON-RPC::
177+
178+
import json
179+
import random
180+
import urllib.request
181+
182+
USER = 'user@domain.tld'
183+
APIKEY = 'your_apikey'
184+
185+
def json_rpc(url, method, params):
186+
data = {
187+
'jsonrpc': '2.0',
188+
'method': method,
189+
'params': params,
190+
'id': random.randint(0, 1000000000),
191+
}
192+
req = urllib.request.Request(url=url, data=json.dumps(data).encode(), headers={
193+
"Content-Type": "application/json",
194+
})
195+
reply = json.loads(urllib.request.urlopen(req).read().decode('UTF-8'))
196+
if reply.get('error'):
197+
raise Exception(reply['error'])
198+
return reply['result']
199+
200+
def call(url, service, method, *args):
201+
return json_rpc(url, 'call', {'service': service, 'method': method, 'args': args})
202+
203+
url = 'https://www.odoo.com/jsonrpc'
204+
uid = call(url, 'common', 'login', 'openerp', USER, APIKEY)
205+
databases_list = call(url, 'object', 'execute', 'openerp', uid, APIKEY, 'odoo.database', 'list')

‎content/applications/productivity/voip.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ predefined rules. Features like call recording and analytics provide insights in
1818
response times, helping teams track communication efficiency.
1919

2020
.. cards::
21-
.. card:: VoIP widget
21+
.. card:: VoIP actions
2222
:target: voip/voip_widget
2323
:large:
2424

@@ -60,7 +60,7 @@ provider to the Odoo database.
6060
VoIP providers
6161
--------------
6262

63-
While |VOIP| setup is minimal in Odoo, all configuration happens in the external |VOIP| service
63+
While |VOIP| setup is minimal in Odoo, most configuration happens in the external |VOIP| service
6464
provider. Two verified providers are :doc:`OnSIP <voip/onsip>` and :doc:`Axivox <voip/axivox>`.
6565
Click on the cards below to learn how to configure these service providers in the Odoo database. If
6666
these providers cannot be used, an alternate provider must meet these requirements to connect with
@@ -118,5 +118,4 @@ sales teams, but can be useful for other teams as well.
118118
voip/axivox
119119
voip/voip_widget
120120
voip/devices_integrations
121-
voip/transfer_forward
122121
voip/sales_calls

0 commit comments

Comments
 (0)
Please sign in to comment.