From 6b40002f987bbe30fc30f5e72ca744ef79b4c658 Mon Sep 17 00:00:00 2001 From: "Richard Mathot (OpenERP)" Date: Fri, 21 Feb 2014 12:53:47 +0100 Subject: [PATCH] [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 --- openerp/addons/base/ir/ir_actions.py | 2 ++ openerp/addons/base/ir/ir_actions.xml | 1 + 2 files changed, 3 insertions(+) diff --git a/openerp/addons/base/ir/ir_actions.py b/openerp/addons/base/ir/ir_actions.py index 31c170068c8..9adbf2c608f 100644 --- a/openerp/addons/base/ir/ir_actions.py +++ b/openerp/addons/base/ir/ir_actions.py @@ -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): diff --git a/openerp/addons/base/ir/ir_actions.xml b/openerp/addons/base/ir/ir_actions.xml index 7ac0252da80..26c08d4f1b0 100644 --- a/openerp/addons/base/ir/ir_actions.xml +++ b/openerp/addons/base/ir/ir_actions.xml @@ -412,6 +412,7 @@
  • cr: database cursor
  • uid: current user id
  • context: current context
  • +
  • workflow: Workflow engine
  • Example of condition expression using Python