[ADD] Enable access to workflow engine in server actions that run arbitrary python code

(a workflow variable gives now access to trg_* methods of the workflow engine)

bzr revid: rim@openerp.com-20140221115347-rpar6uyiwx1z9deu
This commit is contained in:
Richard Mathot (OpenERP) 2014-02-21 12:53:47 +01:00
parent 170f3ef1f9
commit 6b40002f98
2 changed files with 3 additions and 0 deletions

View File

@ -552,6 +552,7 @@ class ir_actions_server(osv.osv):
# - uid: current user id
# - context: current context
# - time: Python time module
# - workflow: Workflow engine
# If you plan to return an action, assign: action = {...}""",
'use_relational_model': 'base',
'use_create': 'new',
@ -936,6 +937,7 @@ class ir_actions_server(osv.osv):
'uid': uid,
'user': user,
'context': context,
'workflow': workflow
}
def run(self, cr, uid, ids, context=None):

View File

@ -412,6 +412,7 @@
<li>cr: database cursor</li>
<li>uid: current user id</li>
<li>context: current context</li>
<li>workflow: Workflow engine</li>
</ul>
<div>
<p>Example of condition expression using Python</p>