From 0a4ce899c55bed801cedc90b4bcb6ed1278b2e87 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 14 May 2020 12:48:06 +0000 Subject: [PATCH] [FIX] web: pivot no content helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit reverts [1], which fixed the no content helper message of the pivot view, by moving the message definition in the JS. With Owl components, one must always use the translation function in the env (env._t), and no longer import it from 'web.core'. Moreover, there is no valid reason to define the message in JS here, except that there was a bug in owl, that has been fixed by [2] (merged in Odoo by the previous commit). [1] https://github.com/odoo/odoo/commit/c7cc672aba669175280d619ad39b14daefd7733f [2] https://github.com/odoo/owl/commit/2af8cccd65424ea75fbaa9f0a83c6974be4b1b5d closes odoo/odoo#51442 Signed-off-by: Géry Debongnie (ged) Signed-off-by: Aaron Bohy (aab) --- addons/web/static/src/js/views/pivot/pivot_renderer.js | 5 ----- addons/web/static/src/xml/pivot.xml | 7 ++++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/web/static/src/js/views/pivot/pivot_renderer.js b/addons/web/static/src/js/views/pivot/pivot_renderer.js index 95681d8f1c7..8335c7c29f5 100644 --- a/addons/web/static/src/js/views/pivot/pivot_renderer.js +++ b/addons/web/static/src/js/views/pivot/pivot_renderer.js @@ -4,8 +4,6 @@ odoo.define('web.PivotRenderer', function (require) { const OwlAbstractRenderer = require('web.AbstractRendererOwl'); const field_utils = require('web.field_utils'); const patchMixin = require('web.patchMixin'); - const core = require('web.core'); - const _t = core._t; const { useExternalListener, useState, onMounted, onPatched } = owl.hooks; @@ -52,9 +50,6 @@ odoo.define('web.PivotRenderer', function (require) { if (!this.env.device.isMobile) { useExternalListener(window, 'click', this._resetState); } - if (!props.hasData || !props.measures.length) { - this.description = _t("Try to add some records, or make sure that there is at least one measure and no active filter in the search bar."); - } } //---------------------------------------------------------------------- diff --git a/addons/web/static/src/xml/pivot.xml b/addons/web/static/src/xml/pivot.xml index 1864052f0be..9522cb7e1c4 100644 --- a/addons/web/static/src/xml/pivot.xml +++ b/addons/web/static/src/xml/pivot.xml @@ -2,7 +2,12 @@
- + + + Try to add some records, or make sure that there is at least one measure and no active filter in the search bar + + +