[IMP] optimizes pivot table so that it doesn't reload data when the groupbys have been changed in such a way that it should only fold some headers (addon web_graph)

bzr revid: ged@openerp.com-20140226130424-rtb5iof0c14caf56
This commit is contained in:
Gery Debongnie 2014-02-26 14:04:24 +01:00
parent e7306f2c4a
commit eb1eb48ef3
1 changed files with 7 additions and 0 deletions

View File

@ -151,6 +151,13 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({
return;
}
if (!dom_changed && col_reduced && row_reduced) {
this.pivot.fold_with_depth(this.pivot.rows, row_gbs.length);
this.pivot.fold_with_depth(this.pivot.cols, col_gbs.length);
this.display_data();
return;
}
if (dom_changed || row_gb_changed || col_gb_changed) {
this.pivot.set(domain, row_gbs, col_gbs).then(this.proxy('display_data'));
}