[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
This commit is contained in:
Mohammed Shekha (OpenERP)
2013-12-03 14:18:21 +05:30
parent a092227c6e
commit a4bca7c775
+8
View File
@@ -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) {