[MERGE] [IMP] ir_actions: allow using workflows in server actions.

bzr revid: tde@openerp.com-20140221141238-4tfi6ojxs86arc41
This commit is contained in:
Thibault Delavallée
2014-02-21 15:12:38 +01:00
3 changed files with 5 additions and 1 deletions
+2
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):
+1
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>
+2 -1
View File
@@ -97,7 +97,8 @@ class TestServerActions(TestServerActionsBase):
self.ir_actions_server.write(cr, uid, self.act_id, {
'state': 'code',
'code': """partner_name = obj.name + '_code'
self.pool["res.partner"].create(cr, uid, {"name": partner_name}, context=context)"""
self.pool["res.partner"].create(cr, uid, {"name": partner_name}, context=context)
workflow"""
})
run_res = self.ir_actions_server.run(cr, uid, [self.act_id], context=self.context)
self.assertFalse(run_res, 'ir_actions_server: code server action correctly finished should return False')