Fabien Meghazi (OpenERP) has proposed merging lp:~openerp-dev/openerp-web/7.0-active-id-in-context-one-fix-to-rule-them-all-fme into lp:openerp-web/7.0.
Requested reviews: Xavier (Open ERP) (xmo) For more details, see: https://code.launchpad.net/~openerp-dev/openerp-web/7.0-active-id-in-context-one-fix-to-rule-them-all-fme/+merge/146606 This branch change the heuristic used in order to disable custom default filters in search. Before : - We disabled them when `active_id` string was found in the context string (unevaluated) in View#do_execute_action() Now : - In ActionManager#do_action(), just after the action context is evaluated, when an `active_id` is present in the context, we disable the default custom filters -- https://code.launchpad.net/~openerp-dev/openerp-web/7.0-active-id-in-context-one-fix-to-rule-them-all-fme/+merge/146606 Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openerp-web/7.0-active-id-in-context-one-fix-to-rule-them-all-fme.
=== modified file 'addons/web/static/src/js/views.js' --- addons/web/static/src/js/views.js 2013-02-04 12:43:48 +0000 +++ addons/web/static/src/js/views.js 2013-02-05 10:51:40 +0000 @@ -272,6 +272,12 @@ 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 @@ 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;
_______________________________________________ Mailing list: https://launchpad.net/~openerp-dev-gtk Post to : openerp-dev-gtk@lists.launchpad.net Unsubscribe : https://launchpad.net/~openerp-dev-gtk More help : https://help.launchpad.net/ListHelp