From 58e256093da6477525a89b0a39af2a0366ff44bc Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 7 Dec 2012 11:49:33 +0100 Subject: [PATCH] [FIX] board: missed JS-ification of context and domains evaluations various contexts and domains would remain unevaluated during the loading of board actions, leading to errors down the line bzr revid: xmo@openerp.com-20121207104933-p1fmog7ohljs9wfc --- addons/board/static/src/js/dashboard.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/addons/board/static/src/js/dashboard.js b/addons/board/static/src/js/dashboard.js index 13a51cc663e..0a38c744738 100644 --- a/addons/board/static/src/js/dashboard.js +++ b/addons/board/static/src/js/dashboard.js @@ -176,18 +176,21 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({ action = result, view_mode = action_attrs.view_mode; - if (action_attrs.context && action_attrs.context['dashboard_merge_domains_contexts'] === false) { + // evaluate action_attrs context and domain + action_attrs.context = instance.web.pyeval.eval( + 'context', action_attrs.context || {}); + action_attrs.domain = instance.web.pyeval.eval( + 'domain', action_attrs.domain || [], action_attrs.context); + if (action_attrs.context['dashboard_merge_domains_contexts'] === false) { // TODO: replace this 6.1 workaround by attribute on action.context = action_attrs.context || {}; action.domain = action_attrs.domain || []; } else { - if (action_attrs.context) { - action.context = _.extend((action.context || {}), action_attrs.context); - } - if (action_attrs.domain) { - action.domain = action.domain || []; - action.domain.unshift.apply(action.domain, action_attrs.domain); - } + action.context = instance.web.pyeval.eval( + 'contexts', [action.context || {}, action_attrs.context]); + action.domain = instance.web.pyeval.eval( + 'domains', [action_attrs.domain, action.domain || []], + action.context) } var action_orig = _.extend({ flags : {} }, action);