← Back to team overview

openerp-community-reviewer team mailing list archive

lp:~camptocamp/ocb-web/7.0-ContextGroupByPropagationIssue-1101840 into lp:ocb-web

 

Guewen Baconnier @ Camptocamp has proposed merging lp:~camptocamp/ocb-web/7.0-ContextGroupByPropagationIssue-1101840 into lp:ocb-web.

Requested reviews:
  OpenERP Community Backports Team (ocb)

For more details, see:
https://code.launchpad.net/~camptocamp/ocb-web/7.0-ContextGroupByPropagationIssue-1101840/+merge/198582

Mirroring: https://code.launchpad.net/~openerp-dev/openerp-web/7.0-opw-601491ContextGroupByPropagationIssue-msh

Fixes: lp:1101840

Already fixed in trunk.
-- 
https://code.launchpad.net/~camptocamp/ocb-web/7.0-ContextGroupByPropagationIssue-1101840/+merge/198582
Your team OpenERP Community Backports Team is requested to review the proposed merge of lp:~camptocamp/ocb-web/7.0-ContextGroupByPropagationIssue-1101840 into lp:ocb-web.
=== modified file 'addons/web/static/src/js/views.js'
--- addons/web/static/src/js/views.js	2013-09-14 12:53:36 +0000
+++ addons/web/static/src/js/views.js	2013-12-11 15:02:01 +0000
@@ -1357,6 +1357,14 @@
         };
         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) {


Follow ups