second submodule: website_house_booking
[odoo/odoo.git] / doc / orm-methods.rst
1 .. _orm-methods:
2
3 ORM methods
4 ===========
5
6 .. _orm-workflows:
7
8 Workflow-related methods
9 ------------------------
10
11 .. versionadded:: 7.1
12
13 Creating, deleting, or otherwise manipulating workflow instances is possible
14 right from a Model instance. (Previously, workflows were handled throught a
15 call to ``LocalService('workflow')``. Using the ORM methods is now the preferred
16 way.)
17
18 .. currentmodule:: openerp.osv.orm
19
20 .. automethod:: BaseModel.create_workflow
21   :noindex:
22
23   This is used instead of ``LocalService('workflow').trg_create()``.
24
25 .. automethod:: BaseModel.delete_workflow
26   :noindex:
27
28   This is used instead of ``LocalService('workflow').trg_delete()``.
29
30 .. automethod:: BaseModel.step_workflow
31   :noindex:
32
33   This is used instead of ``LocalService('workflow').trg_write()``.
34
35 .. automethod:: BaseModel.redirect_workflow
36   :noindex:
37
38 .. automethod:: BaseModel.signal_workflow
39   :noindex:
40
41   This is used instead of ``LocalService('workflow').trg_validate()``.
42
43 .. method:: BaseModel.signal_xxx(cr, uid, ids)
44   :noindex:
45
46   Sends a signal ``xxx`` to the workflow instances bound to the given record
47   IDs. (This is implemented using ``__getattr__`` so no source link is
48   rendered on the right.)
49
50   This is used instead of ``LocalService('workflow').trg_validate()``.
51
52
53 .. note::
54   Low-level access to the workflows is still possible by using the
55   ``openerp.workflow`` module, that is, in a similar way to what was possible
56   with the previous ``LocalService('workflow')`` access. This may be useful
57   when looking-up a model in the registry and/or its records is not necessary.
58   For instance when working with raw model names and record IDs is preferred (to
59   avoid hitting unnecessarily the database). But this is something that should be
60   carefully considered as it would bypass the ORM methods (and thus any inherited
61   behaviors).