From 3d1d7ee39cd9e82c0499af533ae1e1553c4e3b0a Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Wed, 31 Jul 2013 17:09:43 +0200 Subject: [PATCH] [DOC] workflows: typos, and removed inaccurate environment symbols. bzr revid: vmt@openerp.com-20130731150943-etfvn08fnkhcecvt --- doc/workflows.rst | 55 +++++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/doc/workflows.rst b/doc/workflows.rst index 86ba78d0275..d8ba89bd1ad 100644 --- a/doc/workflows.rst +++ b/doc/workflows.rst @@ -54,8 +54,8 @@ instance, here is a simple sequence of two activities defined in XML:: A worfklow is always defined with respect to a particular model (the model is -given by attribute ``osv`` on the model ``workflow``). Methods specified in the -activities or transitions will be called on that model. +given by the attribute ``osv`` on the model ``workflow``). Methods specified in +the activities or transitions will be called on that model. In the example code above, a workflow called "test_workflow" is created. It is made up of two activies, named "a" and "b", and one transition, going from "a" @@ -67,10 +67,10 @@ Because ``on_create`` is set to True on the workflow record, the workflow is instanciated for each newly created record. (Otherwise, the workflow should be instanciated by other means, such as from some module Python code.) -When the workflow is instanciated, it begins with activity "a". That activity is -of kind ``function``, which means that the action ``print_a()`` is method call -on the model ``test.workflow`` (the usual ``cr, uid, ids, context`` arguments -are passed for you). +When the workflow is instanciated, it begins with activity "a". That activity +is of kind ``function``, which means that the action ``print_a()`` is a method +call on the model ``test.workflow`` (the usual ``cr, uid, ids, context`` +arguments are passed for you). The transition between "a" and "b" does not specify any condition. This means that the workflow instance immediately goes from "a" to "b" after "a" has been @@ -107,14 +107,8 @@ may be several lines long; in that case, the value of the last one determines whether the transition can be taken. In the condition evaluation environment, several symbols are conveniently -defined: +defined (in addition to the OpenERP ``safe_eval`` environment): -- the database cursor (``cr``), -- the user ID (``uid``), -- the record ID tied to the workflow instance (``id``), -- the record ID wrapped in a list (``ids``), -- the model name (``model``), -- the model instance (``obj``), - all the model column names, and - all the browse record's attributes. @@ -122,14 +116,15 @@ Signals ''''''' In addition to a condition, a transition can specify a signal name. When such -signal name is present, the transition is not taken directly, even if the +a signal name is present, the transition is not taken directly, even if the condition evaluates to ``True``. Instead the transition blocks, waiting to be woken up. In order to wake up a transition with a defined signal name, the signal must be sent to the workflow instance. A common way to send a signal is to use a button in the user interface, using the element ``