diff options
| author | Fabien Meghazi <fme@openerp.com> | 2013-02-05 11:43:26 +0100 |
|---|---|---|
| committer | Fabien Meghazi <fme@openerp.com> | 2013-02-05 11:43:26 +0100 |
| commit | 87368f767227c02f2f4db34ec94d533fbd526671 (patch) | |
| tree | ab1a13a573b16e0bf25c7379c71fc039d997cb2c /addons/web/static/src/js | |
| parent | f63c3caaf223bc079387e7e435037658566940fa (diff) | |
[FIX] When active_id is in context, disable search default custom filters
bzr revid: fme@openerp.com-20130205104326-rab6gx4w51hgjbkb
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/views.js | 11 |
1 files 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; |
