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
=== modified file 'addons/web/static/src/css/base.css'
--- addons/web/static/src/css/base.css 2014-01-31 00:52:02 +0000
+++ addons/web/static/src/css/base.css 2014-02-11 15:32:40 +0000
@@ -2142,7 +2142,7 @@
2142}2142}
2143.openerp .oe_form .oe_form_label_help[for] span, .openerp .oe_form .oe_form_label[for] span {2143.openerp .oe_form .oe_form_label_help[for] span, .openerp .oe_form .oe_form_label[for] span {
2144 font-size: 80%;2144 font-size: 80%;
2145 color: darkGreen;2145 color: darkgreen;
2146 vertical-align: top;2146 vertical-align: top;
2147 position: relative;2147 position: relative;
2148 top: -4px;2148 top: -4px;
@@ -3138,10 +3138,6 @@
3138 border: none;3138 border: none;
3139 padding: 10px 0 3px 0;3139 padding: 10px 0 3px 0;
3140}3140}
3141.openerp .jqstooltip {
3142 height: auto !important;
3143 width: auto !important;
3144}
3145.openerp h5 {3141.openerp h5 {
3146 font-weight: bold;3142 font-weight: bold;
3147 font-size: smaller;3143 font-size: smaller;
@@ -3153,6 +3149,12 @@
3153 margin: 3px 3px 0 !important;3149 margin: 3px 3px 0 !important;
3154}3150}
31553151
3152.jqstooltip {
3153 height: auto !important;
3154 width: auto !important;
3155 padding: 0;
3156}
3157
3156@-moz-document url-prefix() {3158@-moz-document url-prefix() {
3157 .openerp .oe_searchview .oe_searchview_search {3159 .openerp .oe_searchview .oe_searchview_search {
3158 top: -1px;3160 top: -1px;
31593161
=== modified file 'addons/web/static/src/css/base.sass'
--- addons/web/static/src/css/base.sass 2014-01-31 00:52:02 +0000
+++ addons/web/static/src/css/base.sass 2014-02-11 15:32:40 +0000
@@ -2517,10 +2517,7 @@
2517 border: none2517 border: none
2518 padding: 10px 0 3px 02518 padding: 10px 0 3px 0
25192519
2520 // Customize for kanban tooltip2520
2521 .jqstooltip
2522 height: auto !important
2523 width: auto !important
25242521
2525 // Customize for chatter2522 // Customize for chatter
2526 h52523 h5
@@ -2531,7 +2528,12 @@
2531 .oe_msg_subtype_check2528 .oe_msg_subtype_check
2532 margin: 3px 3px 0 !important2529 margin: 3px 3px 0 !important
2533 // }}}2530 // }}}
25342531// Customize for kanban tooltip
2532.jqstooltip
2533 height: auto !important
2534 width: auto !important
2535 padding: 0
2536
2535@-moz-document url-prefix()2537@-moz-document url-prefix()
2536 .openerp2538 .openerp
2537 .oe_searchview .oe_searchview_search2539 .oe_searchview .oe_searchview_search
25382540
=== modified file 'addons/web_graph/static/src/js/graph_view.js'
--- addons/web_graph/static/src/js/graph_view.js 2014-01-24 15:16:35 +0000
+++ addons/web_graph/static/src/js/graph_view.js 2014-02-11 15:32:40 +0000
@@ -50,7 +50,7 @@
50 var field_name = field.attrs.name;50 var field_name = field.attrs.name;
51 if (_.has(field.attrs, 'interval')) {51 if (_.has(field.attrs, 'interval')) {
52 field_name = field.attrs.name + ':' + field.attrs.interval;52 field_name = field.attrs.name + ':' + field.attrs.interval;
53 } 53 }
54 if (_.has(field.attrs, 'type')) {54 if (_.has(field.attrs, 'type')) {
55 switch (field.attrs.type) {55 switch (field.attrs.type) {
56 case 'row':56 case 'row':
@@ -77,15 +77,20 @@
77 },77 },
7878
79 do_search: function (domain, context, group_by) {79 do_search: function (domain, context, group_by) {
80 if (this.ignore_do_search) {
81 this.ignore_do_search = false;
82 return;
83 }
84
80 var self = this,85 var self = this,
81 col_group_by = context.col_group_by || this.get_groupbys_from_searchview('ColGroupBy', 'col_group_by');86 col_group_by = self.get_groupbys_from_searchview('ColGroupBy', 'col_group_by');
8287
83 if (!this.graph_widget) {88 if (!this.graph_widget) {
84 if (group_by.length) {89 if (group_by.length) {
85 this.widget_config.row_groupby = group_by;90 this.widget_config.row_groupby = group_by;
86 }91 }
87 if (col_group_by.length) {92 if (col_group_by.length) {
88 this.widget_config.col_groupby = group_by;93 this.widget_config.col_groupby = col_group_by;
89 }94 }
90 this.graph_widget = new openerp.web_graph.Graph(this, this.model, domain, this.widget_config);95 this.graph_widget = new openerp.web_graph.Graph(this, this.model, domain, this.widget_config);
91 this.graph_widget.appendTo(this.$el);96 this.graph_widget.appendTo(this.$el);
@@ -101,16 +106,18 @@
101 this.graph_widget.set(domain, group_by, col_group_by);106 this.graph_widget.set(domain, group_by, col_group_by);
102 },107 },
103108
109 extract_groupby: function (cat_field, context) {
110 context = (_.isString(context)) ? py.eval(context) : context;
111 return context[cat_field];
112 },
113
104 get_groupbys_from_searchview: function (cat_name, cat_field) {114 get_groupbys_from_searchview: function (cat_name, cat_field) {
105 var facet = this.search_view.query.findWhere({category:cat_name}),115 var self=this,
116 facet = this.search_view.query.findWhere({category:cat_name}),
106 groupby_list = facet ? facet.values.models : [];117 groupby_list = facet ? facet.values.models : [];
107 return _.map(groupby_list, function (g) { 118 return _.map(groupby_list, function (g) {
108 var context = g.attributes.value.attrs.context;119 var context = g.attributes.value.attrs.context;
109 if (_.isString(context)) {120 return self.extract_groupby(cat_field, context);
110 return py.eval(context).group_by;
111 } else {
112 return context[cat_field];
113 }
114 });121 });
115 },122 },
116123
@@ -129,6 +136,14 @@
129136
130 if (!_.has(this.search_view, '_s_groupby')) { return; }137 if (!_.has(this.search_view, '_s_groupby')) { return; }
131138
139 if (row_groupby.length && col_groupby.length) {
140 // when two changes to the search view will be done, the method do_search
141 // will be called twice, once with the correct groupby and incorrect col_groupby,
142 // and once with correct informations. This flag is necessary to prevent the
143 // incorrect informations to propagate and trigger useless queries
144 this.ignore_do_search = true;
145 }
146
132 // add row groupbys147 // add row groupbys
133 var row_facet = this.make_row_groupby_facets(row_groupby),148 var row_facet = this.make_row_groupby_facets(row_groupby),
134 row_search_facet = query.findWhere({category:'GroupBy'});149 row_search_facet = query.findWhere({category:'GroupBy'});
135150
=== modified file 'addons/web_graph/static/src/js/graph_widget.js'
--- addons/web_graph/static/src/js/graph_widget.js 2014-01-28 15:11:13 +0000
+++ addons/web_graph/static/src/js/graph_widget.js 2014-02-11 15:32:40 +0000
@@ -258,9 +258,6 @@
258 case 'swap_axis':258 case 'swap_axis':
259 this.swap_axis();259 this.swap_axis();
260 break;260 break;
261 case 'expand_all':
262 this.pivot.expand_all().then(this.proxy('display_data'));
263 break;
264 case 'update_values':261 case 'update_values':
265 this.pivot.update_data().then(this.proxy('display_data'));262 this.pivot.update_data().then(this.proxy('display_data'));
266 break;263 break;
@@ -287,25 +284,30 @@
287284
288 if (header.expanded) {285 if (header.expanded) {
289 this.fold(header);286 this.fold(header);
290 } else {287 return;
291 if (header.path.length < header.root.groupby.length) {288 }
292 this.expand(id);289 if (header.path.length < header.root.groupby.length) {
293 } else {290 this.expand(id);
294 if (!this.important_fields.length) {291 return;
295 return;292 }
296 }293 if (!this.important_fields.length) {
294 return;
295 }
297296
298 var fields = _.map(this.important_fields, function (field) {297 var fields = _.map(this.important_fields, function (field) {
299 return {id: field.field, value: field.string, type:self.fields[field.field.split(':')[0]].type};298 return {id: field.field, value: field.string, type:self.fields[field.field.split(':')[0]].type};
300 });299 });
301 this.dropdown = $(QWeb.render('field_selection', {fields:fields, header_id:id}));300 if (this.dropdown) {
302 $(event.target).after(this.dropdown);301 this.dropdown.remove();
303 this.dropdown.css({position:'absolute',
304 left:event.pageX,
305 top:event.pageY});
306 this.$('.field-selection').next('.dropdown-menu').toggle();
307 }
308 }302 }
303 this.dropdown = $(QWeb.render('field_selection', {fields:fields, header_id:id}));
304 $(event.target).after(this.dropdown);
305 this.dropdown.css({position:'absolute',
306 left:event.pageX,
307 top:event.pageY});
308 this.$('.field-selection').next('.dropdown-menu').toggle();
309
310
309 },311 },
310312
311 field_selection: function (event) {313 field_selection: function (event) {
312314
=== modified file 'addons/web_graph/static/src/xml/web_graph.xml'
--- addons/web_graph/static/src/xml/web_graph.xml 2014-01-17 14:43:03 +0000
+++ addons/web_graph/static/src/xml/web_graph.xml 2014-02-11 15:32:40 +0000
@@ -35,9 +35,6 @@
35 <label class="btn btn-default" data-choice="swap_axis" title="Swap Axis">35 <label class="btn btn-default" data-choice="swap_axis" title="Swap Axis">
36 <span class="fa fa-expand"></span>36 <span class="fa fa-expand"></span>
37 </label>37 </label>
38 <label class="btn btn-default" data-choice="expand_all" title="Expand All">
39 <span class="fa fa-arrows-alt"></span>
40 </label>
41 <label class="btn btn-default" data-choice="update_values" title="Reload Data">38 <label class="btn btn-default" data-choice="update_values" title="Reload Data">
42 <span class="fa fa-refresh"></span>39 <span class="fa fa-refresh"></span>
43 </label>40 </label>

Subscribers

People subscribed via source and target branches