From c0439810efa83009741eb9307794e5cafb943df3 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 7 Mar 2012 17:05:03 +0100 Subject: [PATCH] [FIX] Add to dashboard domain & context merging problems bzr revid: fme@openerp.com-20120307160503-w1mha79xiznl4x6h --- addons/web/controllers/main.py | 1 + .../web_dashboard/static/src/js/dashboard.js | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 71d01e2ef0a..fc1e1eb958e 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1344,6 +1344,7 @@ class SearchView(View): ctx = common.nonliterals.CompoundContext(context_to_save) ctx.session = req.session ctx = ctx.evaluate() + ctx['dashboard_merge_domains_contexts'] = False # TODO: replace this 6.1 workaround by attribute on domain = common.nonliterals.CompoundDomain(domain) domain.session = req.session domain = domain.evaluate() diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index 698d0b7da08..e445bf6c1ed 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -145,13 +145,20 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ action = result.result, view_mode = action_attrs.view_mode; - 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); + if (action_attrs.context && 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); + } } + var action_orig = _.extend({ flags : {} }, action); if (view_mode && view_mode != action.view_mode) {