[ADD] action.flags.default_view defines default view to switch on when viewmanager is created.

bzr revid: fme@openerp.com-20111212094152-26eto8s1k9wlhxne
This commit is contained in:
Fabien Meghazi 2011-12-12 10:41:52 +01:00
parent d9bbf2f390
commit 17b76fdc7e
1 changed files with 3 additions and 2 deletions

View File

@ -234,8 +234,9 @@ session.web.ViewManager = session.web.Widget.extend(/** @lends session.web.View
if (this.flags.views_switcher === false) {
this.$element.find('.oe_vm_switch').hide();
}
// switch to the first one in sequence
return this.on_mode_switch(this.views_src[0].view_type);
// If no default view defined, switch to the first one in sequence
var default_view = this.flags.default_view || this.views_src[0].view_type;
return this.on_mode_switch(default_view);
},
/**
* Asks the view manager to switch visualization mode.