[FIX] web: usability issue: display form view icon

form view icon should always be displayed in the view manager.  This
is useful in some situations:
* switch to form view from editable list view
* refresh a form view
This commit is contained in:
Géry Debongnie
2015-01-09 13:10:14 +01:00
parent 66644e856c
commit 278ff38dbe
2 changed files with 3 additions and 5 deletions
+2 -4
View File
@@ -590,7 +590,7 @@ instance.web.ViewManager = instance.web.Widget.extend({
self.view_order.push(view_descr);
self.views[view_type] = view_descr;
});
this.multiple_views = (self.view_order.length - ('form' in this.views ? 1 : 0)) > 1;
this.multiple_views = (self.view_order.length > 1);
},
/**
* @returns {jQuery.Deferred} initial view loading promise
@@ -625,9 +625,7 @@ instance.web.ViewManager = instance.web.Widget.extend({
action : self.action,
action_views_ids : views_ids,
}, self.flags, self.flags[view.type], view.options);
if (view.type !== 'form') {
self.$('.oe-vm-switch-' + view.type).tooltip();
}
self.$('.oe-vm-switch-' + view.type).tooltip();
});
this.$('.oe_debug_view').click(this.on_debug_changed);
this.$el.addClass("oe_view_manager_" + ((this.action && this.action.target) || 'current'));
+1 -1
View File
@@ -495,7 +495,7 @@
<t t-if="widget.multiple_views">
<div class="oe-view-manager-switch btn-group btn-group-sm">
<t t-foreach="widget.view_order" t-as="view">
<button type="button" t-attf-class="btn btn-default fa oe-vm-switch-#{view.type}" t-att-data-view-type="view.type" t-att-title="view.label" t-if="view.type!=='form'">
<button type="button" t-attf-class="btn btn-default fa oe-vm-switch-#{view.type}" t-att-data-view-type="view.type" t-att-title="view.label">
</button>
</t>
</div>