summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/owl_compatibility.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2020-01-27 08:54:59 +0000
committerAaron Bohy <aab@odoo.com>2020-01-27 08:58:36 +0000
commitf2de55322e4d417815e6757517163dd0cff544cc (patch)
tree7060ed340fec36400c8ca37497270d8f6a1730f4 /addons/web/static/src/js/owl_compatibility.js
parent23878ee11ab121bb2d753e64c1d631ba2b85f6e0 (diff)
[FIX] web: ComponentAdapter: do not override render
In Owl, 'render' is a (async) function of Component. It should not be overriden in Component specifications, especially to do something else (in this case, rendering the sub widget), without calling super. closes odoo/odoo#43980 Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Diffstat (limited to 'addons/web/static/src/js/owl_compatibility.js')
-rw-r--r--addons/web/static/src/js/owl_compatibility.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/addons/web/static/src/js/owl_compatibility.js b/addons/web/static/src/js/owl_compatibility.js
index ff119f93f8d..d2a82e1f8b4 100644
--- a/addons/web/static/src/js/owl_compatibility.js
+++ b/addons/web/static/src/js/owl_compatibility.js
@@ -123,7 +123,7 @@ odoo.define('web.OwlCompatibility', function () {
*/
willUpdateProps(nextProps) {
if (this.widget) {
- return this.update(nextProps);
+ return this.updateWidget(nextProps);
}
}
@@ -138,7 +138,7 @@ odoo.define('web.OwlCompatibility', function () {
__patch(vnode) {
if (this.widget) {
if (this.__owl__.vnode) { // not at first rendering
- this.render();
+ this.renderWidget();
}
vnode.elm = this.widget.el;
}
@@ -202,8 +202,8 @@ odoo.define('web.OwlCompatibility', function () {
* @param {Object} nextProps
* @returns {Promise}
*/
- update(/*nextProps*/) {
- console.warn(`ComponentAdapter: Widget could not be updated, maybe override 'update' function?`);
+ updateWidget(/*nextProps*/) {
+ console.warn(`ComponentAdapter: Widget could not be updated, maybe override 'updateWidget' function?`);
}
/**
@@ -211,8 +211,8 @@ odoo.define('web.OwlCompatibility', function () {
* function will be called just before patchin the DOM, s.t. the DOM is
* updated at once. It must be synchronous
*/
- render() {
- console.warn(`ComponentAdapter: Widget could not be re-rendered, maybe override 'render' function?`);
+ renderWidget() {
+ console.warn(`ComponentAdapter: Widget could not be re-rendered, maybe override 'renderWidget' function?`);
}
/**