[IMP] some cleanups in graph/kanban views

notable: disable the group by integration in graph view, because of crash (the search view was rewritten and too much search logic was in the graph view.  This is a temporary measure, the graph view will be split into pivot/graph views, and the search integration will be done correctly in the near future.
This commit is contained in:
Géry Debongnie
2014-10-21 09:33:51 +02:00
parent 16aff1132b
commit a8bd1fa8ba
4 changed files with 11 additions and 12 deletions
+4 -8
View File
@@ -114,12 +114,8 @@ instance.web_graph.GraphView = instance.web.View.extend({
this.widget_config.measures = measures;
}
this.graph_widget = new openerp.web_graph.Graph(this, this.model, domain, this.widget_config);
this.graph_widget.appendTo(this.$el);
this.ViewManager.on('switch_mode', this, function (e) {
if (e === 'graph') {
var group_bys = self.get_groupbys_from_searchview();
this.graph_widget.set(domain, group_bys.group_by, group_bys.col_group_by, group_bys.measures);
}
this.graph_widget.appendTo(this.$el).done(function () {
});
return;
}
@@ -226,7 +222,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
return {
category:'GroupBy',
values: this.make_groupby_values(groupbys, 'group_by'),
icon:'w',
icon:'fa fa-bars',
field: this.search_view._s_groupby
};
},
@@ -235,7 +231,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
return {
category:'ColGroupBy',
values: this.make_groupby_values(groupbys, 'col_group_by'),
icon:'f',
icon:'fa fa-bars fa-rotate-90',
field: this.col_search_field
};
},
@@ -122,6 +122,7 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({
// this method gets the fields that appear in the search view, under the
// 'Groupby' heading
get_search_fields: function () {
return [];
var self = this;
var groupbygroups = _(this.search_view.drawer.inputs).select(function (g) {
+5 -3
View File
@@ -43,6 +43,9 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
this.currently_dragging = {};
this.limit = options.limit || 40;
this.add_group_mutex = new $.Mutex();
if (!this.options.$buttons.length) {
this.options.$buttons = false;
}
},
view_loading: function(r) {
return this.load_kanban(r);
@@ -69,13 +72,12 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
if (unsorted && default_order) {
this.dataset.set_sort(default_order.split(','));
}
this.$el.addClass(this.fields_view.arch.attrs['class']);
this.$buttons = $(QWeb.render("KanbanView.buttons", {'widget': this}));
if (this.options.$buttons) {
this.$buttons.appendTo(this.options.$buttons);
} else {
this.$el.find('.oe_kanban_buttons').replaceWith(this.$buttons);
this.$('.oe_kanban_buttons').replaceWith(this.$buttons);
}
this.$buttons
.on('click', 'button.oe_kanban_button_new', this.do_add_record)
@@ -490,7 +492,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
},
do_show: function() {
if (this.$buttons) {
if (this.options.$buttons) {
this.$buttons.show();
}
this.do_push_state({});
@@ -15,7 +15,7 @@
<div t-name="KanbanView.buttons" class="oe_kanban_buttons">
<t t-if="widget.options.action_buttons !== false">
<t t-if="widget.is_action_enabled('create')">
<button type="button" class="oe_kanban_button_new btn btn-primary">
<button type="button" class="oe_kanban_button_new btn btn-primary btn-sm">
<t t-esc="widget.options.create_text || _t('Create')"/>
</button>
<span t-if="widget.is_action_enabled('group_create')" class="oe_alternative" style="display: none">