Merge lp:~openerp-dev/openerp-web/saas-3-graph-reporting-fix-ged into lp:~openerp/openerp-web/saas-3

Proposed by Géry Debongnie
Status: Merged
Merged at revision: 3935
Proposed branch: lp:~openerp-dev/openerp-web/saas-3-graph-reporting-fix-ged
Merge into: lp:~openerp/openerp-web/saas-3
Diff against target: 218 lines (+60/-42)
5 files modified
addons/web/static/src/css/base.css (+7/-5)
addons/web/static/src/css/base.sass (+7/-5)
addons/web_graph/static/src/js/graph_view.js (+24/-9)
addons/web_graph/static/src/js/graph_widget.js (+22/-20)
addons/web_graph/static/src/xml/web_graph.xml (+0/-3)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/saas-3-graph-reporting-fix-ged
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+205793@code.launchpad.net

Description of the change

various fixes

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/static/src/css/base.css'
2--- addons/web/static/src/css/base.css 2014-01-31 00:52:02 +0000
3+++ addons/web/static/src/css/base.css 2014-02-11 15:32:40 +0000
4@@ -2142,7 +2142,7 @@
5 }
6 .openerp .oe_form .oe_form_label_help[for] span, .openerp .oe_form .oe_form_label[for] span {
7 font-size: 80%;
8- color: darkGreen;
9+ color: darkgreen;
10 vertical-align: top;
11 position: relative;
12 top: -4px;
13@@ -3138,10 +3138,6 @@
14 border: none;
15 padding: 10px 0 3px 0;
16 }
17-.openerp .jqstooltip {
18- height: auto !important;
19- width: auto !important;
20-}
21 .openerp h5 {
22 font-weight: bold;
23 font-size: smaller;
24@@ -3153,6 +3149,12 @@
25 margin: 3px 3px 0 !important;
26 }
27
28+.jqstooltip {
29+ height: auto !important;
30+ width: auto !important;
31+ padding: 0;
32+}
33+
34 @-moz-document url-prefix() {
35 .openerp .oe_searchview .oe_searchview_search {
36 top: -1px;
37
38=== modified file 'addons/web/static/src/css/base.sass'
39--- addons/web/static/src/css/base.sass 2014-01-31 00:52:02 +0000
40+++ addons/web/static/src/css/base.sass 2014-02-11 15:32:40 +0000
41@@ -2517,10 +2517,7 @@
42 border: none
43 padding: 10px 0 3px 0
44
45- // Customize for kanban tooltip
46- .jqstooltip
47- height: auto !important
48- width: auto !important
49+
50
51 // Customize for chatter
52 h5
53@@ -2531,7 +2528,12 @@
54 .oe_msg_subtype_check
55 margin: 3px 3px 0 !important
56 // }}}
57-
58+// Customize for kanban tooltip
59+.jqstooltip
60+ height: auto !important
61+ width: auto !important
62+ padding: 0
63+
64 @-moz-document url-prefix()
65 .openerp
66 .oe_searchview .oe_searchview_search
67
68=== modified file 'addons/web_graph/static/src/js/graph_view.js'
69--- addons/web_graph/static/src/js/graph_view.js 2014-01-24 15:16:35 +0000
70+++ addons/web_graph/static/src/js/graph_view.js 2014-02-11 15:32:40 +0000
71@@ -50,7 +50,7 @@
72 var field_name = field.attrs.name;
73 if (_.has(field.attrs, 'interval')) {
74 field_name = field.attrs.name + ':' + field.attrs.interval;
75- }
76+ }
77 if (_.has(field.attrs, 'type')) {
78 switch (field.attrs.type) {
79 case 'row':
80@@ -77,15 +77,20 @@
81 },
82
83 do_search: function (domain, context, group_by) {
84+ if (this.ignore_do_search) {
85+ this.ignore_do_search = false;
86+ return;
87+ }
88+
89 var self = this,
90- col_group_by = context.col_group_by || this.get_groupbys_from_searchview('ColGroupBy', 'col_group_by');
91+ col_group_by = self.get_groupbys_from_searchview('ColGroupBy', 'col_group_by');
92
93 if (!this.graph_widget) {
94 if (group_by.length) {
95 this.widget_config.row_groupby = group_by;
96 }
97 if (col_group_by.length) {
98- this.widget_config.col_groupby = group_by;
99+ this.widget_config.col_groupby = col_group_by;
100 }
101 this.graph_widget = new openerp.web_graph.Graph(this, this.model, domain, this.widget_config);
102 this.graph_widget.appendTo(this.$el);
103@@ -101,16 +106,18 @@
104 this.graph_widget.set(domain, group_by, col_group_by);
105 },
106
107+ extract_groupby: function (cat_field, context) {
108+ context = (_.isString(context)) ? py.eval(context) : context;
109+ return context[cat_field];
110+ },
111+
112 get_groupbys_from_searchview: function (cat_name, cat_field) {
113- var facet = this.search_view.query.findWhere({category:cat_name}),
114+ var self=this,
115+ facet = this.search_view.query.findWhere({category:cat_name}),
116 groupby_list = facet ? facet.values.models : [];
117 return _.map(groupby_list, function (g) {
118 var context = g.attributes.value.attrs.context;
119- if (_.isString(context)) {
120- return py.eval(context).group_by;
121- } else {
122- return context[cat_field];
123- }
124+ return self.extract_groupby(cat_field, context);
125 });
126 },
127
128@@ -129,6 +136,14 @@
129
130 if (!_.has(this.search_view, '_s_groupby')) { return; }
131
132+ if (row_groupby.length && col_groupby.length) {
133+ // when two changes to the search view will be done, the method do_search
134+ // will be called twice, once with the correct groupby and incorrect col_groupby,
135+ // and once with correct informations. This flag is necessary to prevent the
136+ // incorrect informations to propagate and trigger useless queries
137+ this.ignore_do_search = true;
138+ }
139+
140 // add row groupbys
141 var row_facet = this.make_row_groupby_facets(row_groupby),
142 row_search_facet = query.findWhere({category:'GroupBy'});
143
144=== modified file 'addons/web_graph/static/src/js/graph_widget.js'
145--- addons/web_graph/static/src/js/graph_widget.js 2014-01-28 15:11:13 +0000
146+++ addons/web_graph/static/src/js/graph_widget.js 2014-02-11 15:32:40 +0000
147@@ -258,9 +258,6 @@
148 case 'swap_axis':
149 this.swap_axis();
150 break;
151- case 'expand_all':
152- this.pivot.expand_all().then(this.proxy('display_data'));
153- break;
154 case 'update_values':
155 this.pivot.update_data().then(this.proxy('display_data'));
156 break;
157@@ -287,25 +284,30 @@
158
159 if (header.expanded) {
160 this.fold(header);
161- } else {
162- if (header.path.length < header.root.groupby.length) {
163- this.expand(id);
164- } else {
165- if (!this.important_fields.length) {
166- return;
167- }
168+ return;
169+ }
170+ if (header.path.length < header.root.groupby.length) {
171+ this.expand(id);
172+ return;
173+ }
174+ if (!this.important_fields.length) {
175+ return;
176+ }
177
178- var fields = _.map(this.important_fields, function (field) {
179- return {id: field.field, value: field.string, type:self.fields[field.field.split(':')[0]].type};
180- });
181- this.dropdown = $(QWeb.render('field_selection', {fields:fields, header_id:id}));
182- $(event.target).after(this.dropdown);
183- this.dropdown.css({position:'absolute',
184- left:event.pageX,
185- top:event.pageY});
186- this.$('.field-selection').next('.dropdown-menu').toggle();
187- }
188+ var fields = _.map(this.important_fields, function (field) {
189+ return {id: field.field, value: field.string, type:self.fields[field.field.split(':')[0]].type};
190+ });
191+ if (this.dropdown) {
192+ this.dropdown.remove();
193 }
194+ this.dropdown = $(QWeb.render('field_selection', {fields:fields, header_id:id}));
195+ $(event.target).after(this.dropdown);
196+ this.dropdown.css({position:'absolute',
197+ left:event.pageX,
198+ top:event.pageY});
199+ this.$('.field-selection').next('.dropdown-menu').toggle();
200+
201+
202 },
203
204 field_selection: function (event) {
205
206=== modified file 'addons/web_graph/static/src/xml/web_graph.xml'
207--- addons/web_graph/static/src/xml/web_graph.xml 2014-01-17 14:43:03 +0000
208+++ addons/web_graph/static/src/xml/web_graph.xml 2014-02-11 15:32:40 +0000
209@@ -35,9 +35,6 @@
210 <label class="btn btn-default" data-choice="swap_axis" title="Swap Axis">
211 <span class="fa fa-expand"></span>
212 </label>
213- <label class="btn btn-default" data-choice="expand_all" title="Expand All">
214- <span class="fa fa-arrows-alt"></span>
215- </label>
216 <label class="btn btn-default" data-choice="update_values" title="Reload Data">
217 <span class="fa fa-refresh"></span>
218 </label>

Subscribers

People subscribed via source and target branches