From d762e047a518270cc16bcf4a856fa45d698a3f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 20 Mar 2015 12:48:22 +0100 Subject: [PATCH] Don't evaluate anymore relate action with the record issue2474 --- src/action.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/action.js b/src/action.js index 0185700cac..b47595e31c 100644 --- a/src/action.js +++ b/src/action.js @@ -203,17 +203,17 @@ Sao.Action.evaluate = function(action, atype, record) { action = jQuery.extend({}, action); - switch (atype) { - case 'print': - case 'action': - // TODO - break; - case 'relate': - // TODO - break; - default: - throw new Error('Action type ' + atype + ' is not supported'); + var email = {}; + if ('pyson_email' in action) { + email = record.expr_eval(action.pyson_email); + if (jQuery.isEmptyObject(email)) { + email = {}; + } } + if (!('subject' in email)) { + email.subject = action.name.replace(/_/g, ''); + } + action.email = email; return action; }; }());