[FIX] if value may not be a promise, return the wrapped value if wrapping it anyway

bzr revid: xmo@openerp.com-20120726143141-4wbrqq29qqhvwhqw
This commit is contained in:
Xavier Morel 2012-07-26 16:31:41 +02:00
parent 18afaaa1c1
commit 7ccf2ad2a5
1 changed files with 2 additions and 3 deletions

View File

@ -396,7 +396,7 @@ instance.web.ViewManager = instance.web.Widget.extend({
.find('.oe_view_manager_switch a').filter('[data-view-type="' + view_type + '"]')
.parent().addClass('active');
$.when(view_promise).then(function () {
return $.when(view_promise).then(function () {
_.each(_.keys(self.views), function(view_name) {
var controller = self.views[view_name].controller;
if (controller) {
@ -418,7 +418,6 @@ instance.web.ViewManager = instance.web.Widget.extend({
}
});
});
return view_promise;
},
do_create_view: function(view_type) {
// Lazy loading of views
@ -1129,7 +1128,7 @@ instance.web.View = instance.web.Widget.extend({
this.view_id = view_id;
this.set_default_options(options);
},
start: function() {
start: function () {
return this.load_view();
},
load_view: function() {