From 87368f767227c02f2f4db34ec94d533fbd526671 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Tue, 5 Feb 2013 11:43:26 +0100 Subject: [PATCH] [FIX] When active_id is in context, disable search default custom filters bzr revid: fme@openerp.com-20130205104326-rab6gx4w51hgjbkb --- addons/web/static/src/js/views.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 075312e639d..e013edca0f3 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -272,6 +272,12 @@ instance.web.ActionManager = instance.web.Widget.extend({ if (action.context) { action.context = instance.web.pyeval.eval( 'context', action.context); + if (action.context.active_id) { + // Here we assume that when an `active_id` is used in the context, + // we are in a `related` action, so we disable the searchview's + // default custom filters. + action.context.search_disable_custom_filters = true; + } } if (action.domain) { action.domain = instance.web.pyeval.eval( @@ -1276,11 +1282,6 @@ instance.web.View = instance.web.Widget.extend({ active_ids: [record_id], active_model: dataset.model }); - if (("" + action.context).match(/\bactive_id\b/)) { - // Special case: when the context is evaluted using - // the active_id, we want to disable the custom filters. - ncontext.add({ search_disable_custom_filters: true }); - } } ncontext.add(action.context || {}); action.context = ncontext;