[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
This commit is contained in:
Gery Debongnie 2014-04-03 11:40:50 +02:00
parent 729cd2ce02
commit 0d4732b5c4
1 changed files with 2 additions and 2 deletions

View File

@ -219,8 +219,7 @@ openerp.web_graph.PivotTable = openerp.web.Class.extend({
header.root.groupby.push(groupby); header.root.groupby.push(groupby);
} }
return this.perform_requests(this_gb, other_gbs, header.domain).then(function () { return this.perform_requests(this_gb, other_gbs, header.domain).then(function () {
var data = Array.prototype.slice.call(arguments); var data = Array.prototype.slice.call(arguments).slice(other_gbs.length + 1);
data = data.slice(other_gbs.length + 1, data.length);
_.each(data, function (data_pt) { _.each(data, function (data_pt) {
self.make_headers_and_cell( self.make_headers_and_cell(
data_pt, header.root.headers, other_root.headers, 1, header.path, true); 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)) { if (corresponding_header && (!header.expanded)) {
corresponding_header.expanded = false; corresponding_header.expanded = false;
corresponding_header.children = [];
} }
}); });
var updated_headers = _.filter(new_headers, function (header) { var updated_headers = _.filter(new_headers, function (header) {