From c2d5a4beaf7c73e51d9a45993dda0fc84627d086 Mon Sep 17 00:00:00 2001 From: Hardik Prajapati Date: Tue, 21 Apr 2020 11:25:07 +0000 Subject: [PATCH] [FIX] web: pivot view nocontenthelp message Since the commit https://github.com/odoo/odoo/commit/46cf65d68e9c13193dff4b563b9b0bbb2199dfc1 when help is not defined in action then nocontenthelp is displayed as [object, object] due to the desciption passed from renderder of the pivot view. So in this commit while calling the NoContentHelper pass the descitption as string instead of jquery element. we can use the t-value in template but that string will create issue for transalation so pass the desctiption from the pivot render. closes odoo/odoo#50347 Taskid: 2240167 Closes: #49859 X-original-commit: c7cc672aba669175280d619ad39b14daefd7733f Signed-off-by: Yannick Tivisse (yti) --- addons/web/static/src/js/views/pivot/pivot_renderer.js | 5 +++++ addons/web/static/src/xml/pivot.xml | 6 +----- 2 files changed, 6 insertions(+), 5 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 8335c7c29f5..95681d8f1c7 100644 --- a/addons/web/static/src/js/views/pivot/pivot_renderer.js +++ b/addons/web/static/src/js/views/pivot/pivot_renderer.js @@ -4,6 +4,8 @@ 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; @@ -50,6 +52,9 @@ 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 0b16af71f0c..1864052f0be 100644 --- a/addons/web/static/src/xml/pivot.xml +++ b/addons/web/static/src/xml/pivot.xml @@ -2,11 +2,7 @@
- - - Try to add some records, or make sure that there is at least one measure and no active filter in the search bar - - +