diff options
| author | Mohammed Shekha <msh@odoo.com> | 2020-08-18 07:22:47 +0000 |
|---|---|---|
| committer | Lucas Perais (lpe) <lpe@odoo.com> | 2020-09-01 11:43:50 +0000 |
| commit | 2eaf49bb05f9278ee9709d0dec130b4c651bfcba (patch) | |
| tree | f73b6f61a12ff5e43247bb804d2abf467f924418 /addons/web/static/src/js/views | |
| parent | 00693dc0b36bebb6b04ef8e81291486334dd4dba (diff) | |
[FIX] web: do not display nocontent help if empty
Have an action which help field has the value:
```
<p></p>
```
Display an empty list or kanban
Before this commit, the nocontent helper was displayed even though there was
nothing to display.
After this commit, an empty html tag is the same as an empty string,
so the helper is not displayed.
task-2320318
closes odoo/odoo#56875
X-original-commit: 3d6bdc5b01a4a94de9baa9bae230e6b34f38dbc9
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views')
| -rw-r--r-- | addons/web/static/src/js/views/abstract_view.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/abstract_view.js b/addons/web/static/src/js/views/abstract_view.js index ae572739c4e..9440bf67b00 100644 --- a/addons/web/static/src/js/views/abstract_view.js +++ b/addons/web/static/src/js/views/abstract_view.js @@ -126,10 +126,15 @@ var AbstractView = Factory.extend({ // button when the graph view is embedded. var isEmbedded = params.isEmbedded || false; + // The noContentHelper's message can be empty, i.e. either a real empty string + // or an empty html tag. In both cases, we consider the helper empty. + var help = params.noContentHelp || ""; + var htmlHelp = document.createElement("div"); + htmlHelp.innerHTML = help; this.rendererParams = { arch: this.arch, isEmbedded: isEmbedded, - noContentHelp: params.noContentHelp, + noContentHelp: htmlHelp.innerText.trim() ? help : "", }; this.controllerParams = { |
