summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/abstract_renderer.js
diff options
context:
space:
mode:
authorDhruv Patel <dhp@odoo.com>2020-06-29 10:02:25 +0000
committerJulien Mougenot <jum@odoo.com>2020-08-14 13:12:07 +0000
commitbb9ef004524e21c642abdff16aa6caa9abbb37ba (patch)
tree0138bb324a9ceb89652838f878582e0b596f2df8 /addons/web/static/src/js/views/abstract_renderer.js
parent26633ea8bb22a55c7dbb3acc75cde7371172d38b (diff)
[IMP] web: support action helper on gantt view
Currently, only List and Kanban view supports the action helper and display the folder icon with the helper text. With this commit we have also provided the action helper support for other views. The logic for no content helper has been moved in abstract_renderer.js so that it can be accessed by all views. This was done mainly to give the action helper to the gantt view. closes odoo/odoo#53902 Task: 2284779 Related: odoo/enterprise#11563 Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: Mohammed Shekha <msh@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/abstract_renderer.js')
-rw-r--r--addons/web/static/src/js/views/abstract_renderer.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/addons/web/static/src/js/views/abstract_renderer.js b/addons/web/static/src/js/views/abstract_renderer.js
index b1e30ca29bd..5e72a4827b7 100644
--- a/addons/web/static/src/js/views/abstract_renderer.js
+++ b/addons/web/static/src/js/views/abstract_renderer.js
@@ -133,6 +133,26 @@ return mvc.Renderer.extend({
this._suppressFocusableElements();
},
/**
+ * @private
+ * @param {Object} context
+ */
+ _renderNoContentHelper: function (context) {
+ let templateName;
+ if (!context && this.noContentHelp) {
+ templateName = "web.ActionHelper";
+ context = { noContentHelp: this.noContentHelp };
+ } else {
+ templateName = "web.NoContentHelper";
+ }
+ const template = document.createElement('template');
+ // FIXME: retrieve owl qweb instance via the env set on Component s.t.
+ // it also works in the tests (importing 'web.env' wouldn't). This
+ // won't be necessary as soon as this will be written in owl.
+ const owlQWeb = owl.Component.env.qweb;
+ template.innerHTML = owlQWeb.renderToString(templateName, context);
+ this.el.append(template.content.firstChild);
+ },
+ /**
* Actual rendering. This method is meant to be overridden by concrete
* renderers.
*