diff options
| author | Gery Debongnie <ged@openerp.com> | 2013-11-20 15:19:14 +0100 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2013-11-20 15:19:14 +0100 |
| commit | a7953bbd850468cbf0abfb41da49f501e6e65a42 (patch) | |
| tree | 53e1c8c4fee15ad7433bb15d39c7024ad19bee54 /addons/web_graph/static | |
| parent | 9e8d6bb8e9811a3569bc35a348cdd22613befe79 (diff) | |
[REF] preparation work to allows row expansion to query and display correct data when columns are already expanded (addon web_graph)
bzr revid: ged@openerp.com-20131120141914-yf4o5sh4gzagh2ym
Diffstat (limited to 'addons/web_graph/static')
| -rw-r--r-- | addons/web_graph/static/src/js/graph.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 7e6f5b78ef7..357fc2b2a8a 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -223,12 +223,13 @@ var PivotTable = instance.web.Widget.extend({ var self = this; if (load_data === true) { - this.get_groups(this.data.row_groupby) + var view_fields = this.data.row_groupby.concat(this.data.measure, this.data.col_groupby); + query_groups_data(this.data.model, view_fields, this.data.domain, this.data.col_groupby, this.data.row_groupby[0]) .then(function (groups) { self.data.groups = groups; return self.get_groups([]); }).then(function (total) { - self.data.total = total; + self.data.total = [total]; self.build_table(); self.draw(false); }); @@ -405,6 +406,7 @@ var PivotTable = instance.web.Widget.extend({ }, make_row: function (group, parent_id) { + group = group[0]; var path, value, expanded, @@ -515,7 +517,7 @@ var PivotTable = instance.web.Widget.extend({ .addClass('icon-minus-sign'); var visible_fields = this.data.row_groupby.concat(this.data.col_groupby, this.data.measure); - query_groups(this.data.model, visible_fields, row.domain, [field_id]) + query_groups_data(this.data.model, visible_fields, row.domain, this.data.col_groupby, field_id) .then(function (groups) { _.each(groups.reverse(), function (group) { var new_row = self.make_row(group, row_id); @@ -547,12 +549,9 @@ var PivotTable = instance.web.Widget.extend({ children: [], cells: [], // a cell is {td:<jquery td>, row_id:<some id>} domain: group[0].model._domain, - // header: col_header }; - // col.header.css('display','none'); col.children.push(new_col.id); insertAfter(self.cols, col, new_col) - // self.cols.push(new_col); _.each(col.cells, function (cell) { var col_path = self.get_row(cell.row_id).path; |
