From ec63f82ad1e0e0ab486fb1b781c0d5b2fdfa06d8 Mon Sep 17 00:00:00 2001 From: "mga@tinyerp.com" <> Date: Thu, 14 Aug 2008 14:10:46 +0530 Subject: [PATCH] small change in other Actions in Server Action bzr revid: mga@tinyerp.com-20080814084046-w8lxbircglwu7ddw --- bin/addons/base/ir/ir_actions.py | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) mode change 100644 => 100755 bin/addons/base/ir/ir_actions.py diff --git a/bin/addons/base/ir/ir_actions.py b/bin/addons/base/ir/ir_actions.py old mode 100644 new mode 100755 index c31b33de6fc..159707cdd1d --- a/bin/addons/base/ir/ir_actions.py +++ b/bin/addons/base/ir/ir_actions.py @@ -352,17 +352,39 @@ class actions_server(osv.osv): logger.notifyChannel('email', netsvc.LOG_INFO, 'Email successfully send to : %s' % (action.address)) else: logger.notifyChannel('email', netsvc.LOG_ERROR, 'Failed to send email to : %s' % (action.address)) + if action.state == 'trigger': - #wf_service = netsvc.LocalService("workflow") - print action.trigger_obj_id - #wf_service.trg_validate(uid, ) + wf_service = netsvc.LocalService("workflow") + res = str(action.trigger_obj_id).split(',') + model = res[0] + id = res[1] + wf_service.trg_validate(uid, model, int(id), action.trigger_name, cr) + if action.state == 'sms': if tools.sms_send(user, password, api_id, text, to) == True: logger.notifyChannel('sms', netsvc.LOG_INFO, 'SMS successfully send to : %s' % (action.address)) else: logger.notifyChannel('sms', netsvc.LOG_ERROR, 'Failed to send SMS to : %s' % (action.address)) if action.state == 'other': - print 'Actions to be Execute', action.child_ids + localdict = { + 'self': self.pool.get(action.model_id.model), + 'context': context, + 'time': time, + 'ids': ids, + 'cr': cr, + 'uid': uid + } + + for act in action.child_ids: + code = """ + action = { + 'res_model': %s, + 'type': %s, + 'name': %s, + 'usage': %s, + } + """ % (action.model_id.model, act.type, act.name, act.usage) + exec action.code in localdict return False actions_server()