[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) <yti@odoo.com>
This commit is contained in:
committed by
Yannick Tivisse
parent
b2f87c7c8e
commit
c2d5a4beaf
@@ -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.");
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@@ -2,11 +2,7 @@
|
||||
<templates>
|
||||
|
||||
<div t-name="web.PivotRenderer" class="o_pivot" owl="1">
|
||||
<t t-if="!props.hasData || !props.measures.length" t-call="web.NoContentHelper">
|
||||
<t t-set="description">
|
||||
Try to add some records, or make sure that there is at least one measure and no active filter in the search bar
|
||||
</t>
|
||||
</t>
|
||||
<t t-if="!props.hasData || !props.measures.length" t-call="web.NoContentHelper"/>
|
||||
<table t-else="1" class="table-hover table-sm table-bordered" t-att-class="{ o_enable_linking: !props.disableLinking }">
|
||||
<thead>
|
||||
<tr t-foreach="props.table.headers" t-as="row" t-key="'header_' + row_index">
|
||||
|
||||
Reference in New Issue
Block a user