From 0d4732b5c4194c7c25a13266dfdd1aed05e534eb Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Thu, 3 Apr 2014 11:40:50 +0200 Subject: [PATCH] [FIX] makes sure the internal data structure of pivot table is correct after update_data (the children were not correct when the tree of headers was not full, after an expand for example (addon web_graph) bzr revid: ged@openerp.com-20140403094050-vjeq4dks86mejuub --- addons/web_graph/static/src/js/pivot_table.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web_graph/static/src/js/pivot_table.js b/addons/web_graph/static/src/js/pivot_table.js index 9231765c485..309bb103fa8 100644 --- a/addons/web_graph/static/src/js/pivot_table.js +++ b/addons/web_graph/static/src/js/pivot_table.js @@ -219,8 +219,7 @@ openerp.web_graph.PivotTable = openerp.web.Class.extend({ header.root.groupby.push(groupby); } return this.perform_requests(this_gb, other_gbs, header.domain).then(function () { - var data = Array.prototype.slice.call(arguments); - data = data.slice(other_gbs.length + 1, data.length); + var data = Array.prototype.slice.call(arguments).slice(other_gbs.length + 1); _.each(data, function (data_pt) { self.make_headers_and_cell( data_pt, header.root.headers, other_root.headers, 1, header.path, true); @@ -369,6 +368,7 @@ openerp.web_graph.PivotTable = openerp.web.Class.extend({ } if (corresponding_header && (!header.expanded)) { corresponding_header.expanded = false; + corresponding_header.children = []; } }); var updated_headers = _.filter(new_headers, function (header) {