diff options
| author | Aaron Bohy <aab@odoo.com> | 2020-05-14 12:48:06 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2020-05-18 12:44:45 +0000 |
| commit | 0a4ce899c55bed801cedc90b4bcb6ed1278b2e87 (patch) | |
| tree | db269927aac467bc88bdbf69baca82d451de3c6f /addons | |
| parent | f71b09725fb6ed18d86b7fea7365f82f5d980d5d (diff) | |
[FIX] web: pivot no content helper
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) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/web/static/src/js/views/pivot/pivot_renderer.js | 5 | ||||
| -rw-r--r-- | 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 @@ <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-if="!props.hasData || !props.measures.length"> + <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-call="web.NoContentHelper"/> + </t> <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"> |
