diff options
| author | Gery Debongnie <ged@openerp.com> | 2013-11-27 16:14:51 +0100 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2013-11-27 16:14:51 +0100 |
| commit | 0d47d906fdf780528fe16fd9ab6686545e6489b6 (patch) | |
| tree | f6d9d198da838da791a34415d95d022f8a6711fb /addons/web_graph/static/src | |
| parent | f5514c70ab0d5980d139409e97d7947497f11902 (diff) | |
[REF] removes reference to rows in expand header method (pivot class) in addon web_graph
bzr revid: ged@openerp.com-20131127151451-t361x3ufdcbtc54f
Diffstat (limited to 'addons/web_graph/static/src')
| -rw-r--r-- | addons/web_graph/static/src/js/pivot.js | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/addons/web_graph/static/src/js/pivot.js b/addons/web_graph/static/src/js/pivot.js index c7bf0ac492a..c94aae5163d 100644 --- a/addons/web_graph/static/src/js/pivot.js +++ b/addons/web_graph/static/src/js/pivot.js @@ -79,34 +79,34 @@ openerp.web_graph.PivotTable = openerp.web.Class.extend({ }); }, - expand: function (row_id, field_id) { + expand: function (header_id, field_id) { var self = this, - row = this.get_header(row_id); + header = this.get_header(header_id); - if (row.path.length == row.root.groupby.length) { - row.root.groupby.push(field_id); + if (header.path.length == header.root.groupby.length) { + header.root.groupby.push(field_id); } - var otherDim = (row.root === this.cols) ? this.rows : this.cols; - return query_groups_data(this.model, this.visible_fields(), row.domain, otherDim.groupby, field_id) + var otherDim = (header.root === this.cols) ? this.rows : this.cols; + return query_groups_data(this.model, this.visible_fields(), header.domain, otherDim.groupby, field_id) .then(function (groups) { _.each(groups.reverse(), function (group) { - var new_row_id = self.make_header(group, row); + var new_header_id = self.make_header(group, header); _.each(group, function (data) { - var col = _.find(otherDim.headers, function (c) { - if (row.root === self.cols) { - return _.isEqual(data.path.slice(1), c.path); - } else { - return _.isEqual(_.rest(data.path), c.path); - } - }); - if (col) { - self.set_value(new_row_id, col.id, data.attributes.aggregates[self.measure]); - } - }); - }); - row.is_expanded = true; - }); + var other = _.find(otherDim.headers, function (h) { + if (header.root === self.cols) { + return _.isEqual(data.path.slice(1), h.path); + } else { + return _.isEqual(_.rest(data.path), h.path); + } + }); + if (other) { + self.set_value(new_header_id, other.id, data.attributes.aggregates[self.measure]); + } + }); + }); + header.is_expanded = true; + }); }, make_header: function (groups, parent) { |
