sync with 7.0
authorMartin Trigaux <mat@openerp.com>
Fri, 25 Apr 2014 11:35:55 +0000 (13:35 +0200)
committerMartin Trigaux <mat@openerp.com>
Fri, 25 Apr 2014 11:35:55 +0000 (13:35 +0200)
bzr revid: mat@openerp.com-20140425113555-nkjxldq61io6kvdo

1  2 
addons/web/static/src/js/views.js

@@@ -1217,7 -1217,7 +1217,7 @@@ instance.web.Sidebar = instance.web.Wid
          this.dataset = dataset;
          this.model_id = model_id;
          if (args && args[0].error) {
-             this.do_warn( instance.web.qweb.render('message_error_uploading'), args[0].error);
+             this.do_warn(_t('Uploading Error'), args[0].error);
          }
          if (!model_id) {
              this.on_attachments_loaded([]);
@@@ -1301,7 -1301,7 +1301,7 @@@ instance.web.View = instance.web.Widget
                  "context": this.dataset.get_context(),
              });
          }
-         return view_loaded_def.then(function(r) {
+         return this.alive(view_loaded_def).then(function(r) {
              self.fields_view = r;
              // add css classes that reflect the (absence of) access rights
              self.$el.addClass('oe_view')
          var context = new instance.web.CompoundContext(dataset.get_context(), action_data.context || {});
          var handler = function (action) {
              if (action && action.constructor == Object) {
 -                var ncontext = new instance.web.CompoundContext(context);
 +                // filter out context keys that are specific to the current action.
 +                // Wrong default_* and search_default_* values will no give the expected result
 +                // Wrong group_by values will simply fail and forbid rendering of the destination view
 +                var ncontext = new instance.web.CompoundContext(
 +                    _.object(_.reject(_.pairs(dataset.get_context().eval()), function(pair) {
 +                      return pair[0].match('^(?:(?:default_|search_default_).+|.+_view_ref|group_by|group_by_no_leaf|active_id|active_ids)$') !== null;
 +                    }))
 +                );
 +                ncontext.add(action_data.context || {});
 +                ncontext.add({active_model: dataset.model});
                  if (record_id) {
                      ncontext.add({
                          active_id: record_id,
                          active_ids: [record_id],
 -                        active_model: dataset.model
                      });
                  }
                  ncontext.add(action.context || {});