From a4bca7c7753a75e7b9d50f26add2e2bd5de27b11 Mon Sep 17 00:00:00 2001 From: "Mohammed Shekha (OpenERP)" Date: Tue, 3 Dec 2013 14:18:21 +0530 Subject: [PATCH] [FIX]Web: Fixed the issue of group and search_default propagated in context to next action while executing button action. bzr revid: msh@openerp.com-20131203084821-0amelfix4bji3wr6 --- addons/web/static/src/js/views.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 21ff627c544..17d91f9ea6d 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -1347,6 +1347,14 @@ instance.web.View = instance.web.Widget.extend({ }; var context = new instance.web.CompoundContext(dataset.get_context(), action_data.context || {}); var handler = function (action) { + if (action_data.model !== dataset.model) { + // filter out context keys that are specific to the action model. + // Wrong default_ and search_default values will no give the expected views + // Wrong group_by values will simply fail and forbid rendering of the destination view + context = _.reject(_.keys(context.eval()), function(key) { + return key.match('^(?:(?:default_|search_default_).+|group_by|group_by_no_leaf)$') !== null; + }); + } if (action && action.constructor == Object) { var ncontext = new instance.web.CompoundContext(context); if (record_id) {