summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/pivot/pivot_controller.js
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2017-03-31 23:28:58 +0200
committerAaron Bohy <aab@odoo.com>2017-04-11 19:44:38 +0200
commit7056ec1ac6e6c23231d9044bb60efc2a0bdb7ae2 (patch)
treea7aa305521e8ce8eb080b66fe826cd600d83b82f /addons/web/static/src/js/views/pivot/pivot_controller.js
parent21324ded09883d08ec951b0e3cc80ff5ed270aed (diff)
[FIX] web: various bugs with pivot view and no data
The pivot view had various small issues causing a crash when transitioning from and to a 'no data' state.
Diffstat (limited to 'addons/web/static/src/js/views/pivot/pivot_controller.js')
-rw-r--r--addons/web/static/src/js/views/pivot/pivot_controller.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/addons/web/static/src/js/views/pivot/pivot_controller.js b/addons/web/static/src/js/views/pivot/pivot_controller.js
index 2aa4cd93797..f53e0f9db7c 100644
--- a/addons/web/static/src/js/views/pivot/pivot_controller.js
+++ b/addons/web/static/src/js/views/pivot/pivot_controller.js
@@ -171,11 +171,13 @@ var PivotController = AbstractController.extend({
*/
_update: function (state) {
this._updateButtons();
- var hasNoContent = !state.measures.length || !state.has_data;
+ var hasNoContent = !state.has_data || !state.measures.length;
if (hasNoContent) {
- this.renderer.$el.detach();
- this.$el.append(QWeb.render('PivotView.nodata'));
+ if (!this.$('.oe_view_nocontent').length) {
+ this.renderer.$el.detach();
+ this.$el.append(QWeb.render('PivotView.nodata'));
+ }
} else {
if (!document.contains(this.renderer.el)) {
this.$('div.oe_view_nocontent').remove();