[MERGE] [IMP] ir_actions: allow using workflows in server actions.
bzr revid: tde@openerp.com-20140221141238-4tfi6ojxs86arc41
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user