[IMP] models: move prefetching of records back to method _prefetch_field
[odoo/odoo.git] / doc / ir_actions.rst
1 .. _ir-actions:
2
3 Ir Actions
4 ===========
5
6 .. _ir-actions-server:
7
8 Server actions
9 ++++++++++++++
10
11 .. versionchanged:: 8.0
12
13 .. currentmodule:: openerp.addons.base.ir.ir_actions
14
15 .. autoclass:: ir_actions_server
16     :members: run, _get_states
17
18 Adding a new sever action
19 -------------------------
20
21 The ``state`` field holds the various available types of server action. In order
22 to add a new server action, the first thing to do is to override the :meth:`~.ir_actions_server._get_states`
23 method that returns the list of values available for the selection field.
24
25 The method called when executing the server action is the :meth:`~.ir_actions_server.run` method. This
26 method calls ``run_action_<STATE>``. When adding a new server action type, you
27 have to define the related method that will be called upon execution.
28
29 Changelog
30 ---------
31
32 `8.0`
33 '''''
34
35 The refactoring of OpenERP 8.0 server actions removed the following types of
36 server action:
37
38  - ``loop``: can be replaced by a ``code`` action
39  - ``dummy``: can be replaced by a void ``code`` action
40  - ``object_create`` and ``object_copy`` have been merged into a single and
41    more understandable ``object_create`` action
42  - ``other`` is renamed ``multi`` and raises in case of loops