[MERGE] [FIX] view_list: avoids getParent() js error when clicking to fast on menu items that load a list view after loading a form view

bzr revid: mat@openerp.com-20140218143111-yot645o83gxvkujb
This commit is contained in:
Martin Trigaux
2014-02-18 15:31:11 +01:00
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -1623,9 +1623,12 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we
function synchronized(fn) {
var fn_mutex = new $.Mutex();
return function () {
var obj = this;
var args = _.toArray(arguments);
args.unshift(this);
return fn_mutex.exec(fn.bind.apply(fn, args));
return fn_mutex.exec(function () {
if (obj.isDestroyed()) { return $.when(); }
return fn.apply(obj, args)
});
};
}
var DataGroup = instance.web.Class.extend({
+1 -1
View File
@@ -1301,7 +1301,7 @@ instance.web.View = instance.web.Widget.extend({
"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')