summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src/js/pivot_table.js
diff options
context:
space:
mode:
authorVidhin Mehta (OpenERP) <vme@tinyerp.com>2014-05-05 10:02:33 +0530
committerVidhin Mehta (OpenERP) <vme@tinyerp.com>2014-05-05 10:02:33 +0530
commite41508cb8d7fd2a2c06e3fab9ce1503e8efa30fa (patch)
tree8e0fbb849cebc9b3ac0f87355a5248f51826a491 /addons/web_graph/static/src/js/pivot_table.js
parent4312b921f3db41529cbd4f501a6b5dcba2bebd08 (diff)
parent8fbebfd752fa8933584711522675d354b3217839 (diff)
[MERGE]Trunk.
bzr revid: vme@tinyerp.com-20140505043233-2t2e2vb1yv86hyxp
Diffstat (limited to 'addons/web_graph/static/src/js/pivot_table.js')
-rw-r--r--addons/web_graph/static/src/js/pivot_table.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/addons/web_graph/static/src/js/pivot_table.js b/addons/web_graph/static/src/js/pivot_table.js
index 6b12829982e..48ae9ec3830 100644
--- a/addons/web_graph/static/src/js/pivot_table.js
+++ b/addons/web_graph/static/src/js/pivot_table.js
@@ -14,6 +14,7 @@ openerp.web_graph.PivotTable = openerp.web.Class.extend({
this.cells = [];
this.domain = domain;
this.no_data = true;
+ this.updating = false;
this.model = model;
this.fields = fields;
this.fields.__count = {type: 'integer', string:_t('Quantity')};
@@ -55,6 +56,13 @@ openerp.web_graph.PivotTable = openerp.web.Class.extend({
},
set: function (domain, row_groupby, col_groupby) {
+ var self = this;
+ if (this.updating) {
+ return this.updating.then(function () {
+ self.updating = false;
+ return self.set(domain, row_groupby,col_groupby);
+ });
+ }
var row_gb_changed = !_.isEqual(row_groupby, this.rows.groupby),
col_gb_changed = !_.isEqual(col_groupby, this.cols.groupby);
@@ -251,7 +259,7 @@ openerp.web_graph.PivotTable = openerp.web.Class.extend({
// to null before calling update_data.
update_data: function () {
var self = this;
- return this.perform_requests().then (function () {
+ this.updating = this.perform_requests().then (function () {
var data = Array.prototype.slice.call(arguments);
self.no_data = !data[0].length;
if (self.no_data) {
@@ -273,6 +281,7 @@ openerp.web_graph.PivotTable = openerp.web.Class.extend({
self.set_headers(row_headers, self.rows);
self.set_headers(col_headers, self.cols);
});
+ return this.updating;
},
make_headers_and_cell: function (data_pts, row_headers, col_headers, index, prefix, expand) {