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

bzr revid: cto@openerp.com-20140217104920-fu8hcqd51bh7qnrp
This commit is contained in:
Cecile Tonglet 2014-02-17 11:49:20 +01:00
parent df0076c67d
commit 5ef7c4a6a1
2 changed files with 6 additions and 3 deletions

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({

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')