1 API changes from OpenERP Web 6.1 to 7.0
2 =======================================
7 The OpenERP Web Client supports the following web browsers:
12 * Any browser using the latest version of Chrome Frame
17 The 6.1 ``DataSet`` API has been deprecated in favor of the smaller
18 and more orthogonal :doc:`Model </rpc>` API, which more closely
19 matches the API in OpenERP Web's Python side and in OpenObject addons
20 and removes most stateful behavior of DataSet.
25 * Actual arbitrary RPC calls can just be remapped on a
26 :js:class:`~openerp.web.Model` instance:
28 .. code-block:: javascript
30 dataset.call(method, args)
34 .. code-block:: javascript
36 dataset.call_and_eval(method, args)
38 can be replaced by calls to :js:func:`openerp.web.Model.call`:
40 .. code-block:: javascript
42 model.call(method, args)
44 If callbacks are passed directly to the older methods, they need to
45 be added to the new one via ``.then()``.
49 The ``context_index`` and ``domain_index`` features were not
50 ported, context and domain now need to be passed in "in full",
51 they won't be automatically filled with the user's current
54 * Shorcut methods (``name_get``, ``name_search``, ``unlink``,
55 ``write``, ...) should be ported to
56 :js:func:`openerp.web.Model.call`, using the server's original
57 signature. On the other hand, the non-shortcut equivalents can now
58 use keyword arguments (see :js:func:`~openerp.web.Model.call`'s
59 signature for details)
61 * ``read_slice``, which allowed a single round-trip to perform a
62 search and a read, should be reimplemented via
63 :js:class:`~openerp.web.Query` objects (see:
64 :js:func:`~openerp.web.Model.query`) for clearer and simpler
65 code. ``read_index`` should be replaced by a
66 :js:class:`~openerp.web.Query` as well, combining
67 :js:func:`~openerp.web.Query.offset` and
68 :js:func:`~openerp.web.Query.first`.
75 The name *DataSet* exists in the CS community consciousness, and
76 (as its name implies) it's a set of data (often fetched from a
77 database, maybe lazily). OpenERP Web's dataset behaves very
78 differently as it does not store (much) data (only a bunch of ids
79 and just enough state to break things). The name "Model" matches
80 the one used on the Python side for the task of building an RPC
81 proxy to OpenERP objects.
85 ``DataSet`` has a number of methods which serve as little more
86 than shortcuts, or are there due to domain and context evaluation
89 The shortcuts really add little value, and OpenERP Web 6.2 embeds
90 a restricted Python evaluator (in javascript) meaning most of the
91 context and domain parsing & evaluation can be moved to the
92 javascript code and does not require cooperative RPC bridging.
94 DataGroup -> also Model
95 -----------------------
97 Alongside the deprecation of ``DataSet`` for
98 :js:class:`~openerp.web.Model`, OpenERP Web 7.0 removes
99 ``DataGroup`` and its subtypes as public objects in favor of a single method on
100 :js:class:`~openerp.web.Query`:
101 :js:func:`~openerp.web.Query.group_by`.
109 While the ``DataGroup`` API worked (mostly), it is quite odd and
110 alien-looking, a bit too Smalltalk-inspired (behaves like a
111 self-contained flow-control structure for reasons which may or may not
114 Because it is heavily related to ``DataSet`` (as it *yields*
115 ``DataSet`` objects), deprecating ``DataSet`` automatically deprecates
116 ``DataGroup`` (if we want to stay consistent), which is a good time to
117 make the API more imperative and look more like what most developers
120 But as ``DataGroup`` users in 6.1 were rare (and there really was little reason
121 to use it), it has been removed as a public API.