diff options
| author | Martin Trigaux <mat@openerp.com> | 2014-02-18 15:31:11 +0100 |
|---|---|---|
| committer | Martin Trigaux <mat@openerp.com> | 2014-02-18 15:31:11 +0100 |
| commit | 8be121ff69d41b7b6a0bb31cd5422f042a99a115 (patch) | |
| tree | 84375a15c3ad056548dac01b16791d737b44fbe3 /addons/web/static | |
| parent | 2e831ab7c377408782ab96c303f6fa50884d76e4 (diff) | |
| parent | 5ef7c4a6a1838a3821ee1bcf14d93d0203e9fbc1 (diff) | |
[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
Diffstat (limited to 'addons/web/static')
| -rw-r--r-- | addons/web/static/src/js/view_list.js | 7 | ||||
| -rw-r--r-- | addons/web/static/src/js/views.js | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index f3ecc373ca5..5bee82c28d2 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -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({ diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 8d04110885c..875b113a82f 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -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') |
