@@ -8,7 +8,7 @@ The library provides few objects to access the Odoo model and the
88associated services of `the Odoo API `_.
99
1010The signature of the methods mimics the standard methods provided by the
11- :class: `osv .Model ` Odoo class. This is intended to help the developer when
11+ :class: `odoo.models .Model ` Odoo class. This is intended to help the developer when
1212developping addons. What is experimented at the interactive prompt should
1313be portable in the application with little effort.
1414
@@ -21,9 +21,9 @@ be portable in the application with little effort.
2121Client and Services
2222-------------------
2323
24- The :class: `Client ` object provides thin wrappers around Odoo RPC services
25- and their methods. Additional helpers are provided to explore the models and
26- list or install Odoo add-ons.
24+ The :class: `Client ` object provides thin wrappers around Odoo Webclient API
25+ and RPC services and their methods. Additional helpers are provided to explore
26+ the models and to list or to install Odoo add-ons.
2727
2828
2929.. autoclass :: Client
@@ -34,6 +34,8 @@ list or install Odoo add-ons.
3434
3535.. automethod :: Client.clone_database
3636
37+ .. automethod :: Client.drop_database
38+
3739.. automethod :: Client.login
3840
3941
@@ -50,9 +52,44 @@ list or install Odoo add-ons.
5052 ``ODOOLY_SSL_UNVERIFIED=1 ``.
5153
5254
55+ Odoo Webclient API
56+ ~~~~~~~~~~~~~~~~~~
57+
58+ These HTTP routes were developed for the Odoo Web application. They are now
59+ used by Odooly to provide high level methods on :class: `Env `
60+ and :class: `Model `.
61+
62+ .. attribute :: Client.database
63+
64+ Expose the ``database `` :class: `WebAPI `.
65+
66+ Example: :meth: `Client.database.list ` method.
67+
68+ .. attribute :: Client.web
69+
70+ Expose the root ``/web `` :class: `WebAPI `.
71+
72+ .. attribute :: Client.web_dataset
73+
74+ Expose the ``/web/dataset `` :class: `WebAPI `.
75+
76+ .. attribute :: Client.web_session
77+
78+ Expose the ``/web/session `` :class: `WebAPI `.
79+
80+ .. attribute :: Client.web_webclient
81+
82+ Expose the ``/web/webclient `` :class: `WebAPI `.
83+
84+
5385Odoo RPC Services
5486~~~~~~~~~~~~~~~~~
5587
88+ .. note ::
89+
90+ These RPC services are deprecated in Odoo 19.0. They are
91+ scheduled for removal in Odoo 20.0 in 2026.
92+
5693The naked Odoo RPC services are exposed too.
5794The :attr: `~Client.db ` and the :attr: `~Client.common ` services expose few
5895methods which might be helpful for server administration. Use the
@@ -70,16 +107,22 @@ Please refer to `the Odoo documentation`_ for more details.
70107 Examples: :meth: `Client.db.list ` or :meth: `Client.db.server_version `
71108 RPC methods.
72109
110+ Removed in Odoo 20.
111+
73112.. attribute :: Client.common
74113
75114 Expose the ``common `` :class: `Service `.
76115
77116 Example: :meth: `Client.common.login_message ` RPC method.
78117
118+ Removed in Odoo 20.
119+
79120.. data :: Client._object
80121
81122 Expose the ``object `` :class: `Service `.
82123
124+ Removed in Odoo 20.
125+
83126.. attribute :: Client._report
84127
85128 Expose the ``report `` :class: `Service `.
@@ -92,12 +135,16 @@ Please refer to `the Odoo documentation`_ for more details.
92135
93136 Removed in OpenERP 7.
94137
138+ .. autoclass :: WebAPI
139+ :members:
140+ :undoc-members:
141+
95142.. autoclass :: Service
96143 :members:
97144 :undoc-members:
98145
99146.. _the Odoo documentation :
100- .. _the Odoo API : http ://doc .odoo.com/v6.1 /developer/12_api .html#api
147+ .. _the Odoo API : https ://www .odoo.com/documentation/19.0 /developer/reference/external_rpc_api .html
101148
102149
103150Environment
@@ -131,6 +178,16 @@ Environment
131178
132179 Cursor on the current database.
133180
181+ .. automethod :: session_authenticate
182+
183+ .. automethod :: session_destroy
184+
185+ .. attribute :: session_info
186+
187+ Dictionary returned when a Webclient session is authenticated.
188+ It contains ``uid `` and ``user_context `` among other user's preferences
189+ and server parameters.
190+
134191 .. automethod :: sudo(user=SUPERUSER_ID)
135192
136193
@@ -151,6 +208,12 @@ Please refer to `the Odoo documentation`_ for details.
151208
152209.. automethod :: Env.execute(obj, method, *params, **kwargs)
153210
211+ .. automethod :: Env._call_kw(obj, method, *params, **kwargs)
212+
213+ .. attribute :: Env._web(obj, method, *params, **kwargs)
214+
215+ Expose the root of the ``/web `` API.
216+
154217.. method :: Env.exec_workflow(obj, signal, obj_id)
155218
156219 Wrapper around ``object.exec_workflow `` RPC method.
@@ -212,7 +275,7 @@ Python script or interactively in a Python session.
212275 It is not recommended to install or upgrade modules in offline mode when
213276 any web server is still running: the operation will not be signaled to
214277 other processes. This restriction does not apply when connected through
215- XML-RPC or JSON- RPC.
278+ Webclient API or other RPC API .
216279
217280
218281.. _model-and-records :
@@ -222,7 +285,7 @@ Model and Records
222285
223286The :class: `Env ` provides a high level API similar to the Odoo API, which
224287encapsulates objects into `Active Records
225- <http ://www.martinfowler.com/eaaCatalog/activeRecord.html> `_.
288+ <https ://www.martinfowler.com/eaaCatalog/activeRecord.html> `_.
226289
227290The :class: `Model ` is instantiated using the ``client.env[...] `` syntax.
228291
0 commit comments