diff options
| author | Yenthe666 <yenthevg@gmail.com> | 2019-07-29 12:49:22 +0000 |
|---|---|---|
| committer | Victor Feyens <vfe@odoo.com> | 2019-07-30 15:39:19 +0000 |
| commit | ce00210b612b2691ff37bb6e06ce908375e4b6cf (patch) | |
| tree | 1d52029c67eec72c1fff39e5555de9769cf391cb /doc/reference | |
| parent | 7092d9d17655937b4d86da14de43892ad20b1c65 (diff) | |
[IMP] doc: remove calls to @api.multi and @api.one
Those two decorators are removed/deprecated since recent commits but some references remained in the documentation.
api.multi is deprecated since https://github.com/odoo/odoo/commit/cc62447a44c2cf4e2edaf8a1f6d94520e799ddd9
api.one was removed with https://github.com/odoo/odoo/commit/407f1f6cdb87a59bbad9f853078d7345cdf9f60c
closes odoo/odoo#35261
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Diffstat (limited to 'doc/reference')
| -rw-r--r-- | doc/reference/guidelines.rst | 6 | ||||
| -rw-r--r-- | doc/reference/orm.rst | 9 |
2 files changed, 4 insertions, 11 deletions
diff --git a/doc/reference/guidelines.rst b/doc/reference/guidelines.rst index c1a282cf19f..f4c5148aaa6 100644 --- a/doc/reference/guidelines.rst +++ b/doc/reference/guidelines.rst @@ -595,12 +595,8 @@ on self to treat each record. for record in self: record.do_cool_stuff() -Avoid to use ``api.one`` decorator : this will probably not do what you expected, -and extending a such method is not as easy than a *api.multi* method, since it -returns a list of result (ordered by recordset ids). - For performance issue, when developping a 'stat button' (for instance), do not -perform a ``search`` or a ``search_count`` in a loop in a ``api.multi`` method. It +perform a ``search`` or a ``search_count`` in a loop. It is recommended to use ``read_group`` method, to compute all value in only one request. .. code-block:: python diff --git a/doc/reference/orm.rst b/doc/reference/orm.rst index f6ae4a7b5c0..e152456c2d7 100644 --- a/doc/reference/orm.rst +++ b/doc/reference/orm.rst @@ -588,8 +588,7 @@ return lists of ids, there is also a decorator managing this: No effect if the method is called in new API style, but transforms the recordset into a list of ids when called from the old API style:: - >>> @api.multi - ... @api.returns('self') + >>> @api.returns('self') ... def some_method(self): ... return self >>> new_style_model = env['a.model'].browse(1, 2, 3) @@ -1165,9 +1164,9 @@ Porting from the old API to the new API * **remove** all ``onchange`` methods on computed fields. Computed fields are automatically re-computed when one of their dependencies is changed, and that is used to auto-generate ``onchange`` by the client -* the decorators :func:`~odoo.api.model` and :func:`~odoo.api.multi` are +* the decorator :func:`~odoo.api.model` is for bridging *when calling from the old API context*, for internal or pure - new-api (e.g. compute) they are useless + new-api (e.g. compute) it is useless * remove :attr:`~odoo.models.Model._default`, replace by ``default=`` parameter on corresponding fields * if a field's ``string=`` is the titlecased version of the field name:: @@ -1186,8 +1185,6 @@ Porting from the old API to the new API * the normal new-api import is ``from odoo import fields, models``. If compatibility decorators are necessary, use ``from odoo import api, fields, models`` -* avoid the :func:`~odoo.api.one` decorator, it probably does not do what - you expect * remove explicit definition of :attr:`~odoo.models.Model.create_uid`, :attr:`~odoo.models.Model.create_date`, :attr:`~odoo.models.Model.write_uid` and |
