summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_renderer.js
diff options
context:
space:
mode:
authorJulien Mougenot <jum@odoo.com>2020-12-22 16:59:46 +0000
committerAaron Bohy <aab@odoo.com>2021-02-11 07:44:15 +0000
commit953fb092636b9919aaa6c6a6cfaffd003ba951d5 (patch)
treef1af3b961f3475c31a7de4560467774135541714 /addons/web/static/src/js/views/basic/basic_renderer.js
parent1f99f5df22b3d36775a7386af170c126a481279b (diff)
[FIX] web,mail: Call on_attach_callback when appending content
Before this commit, the form renderer would call "on_attach_callback" only when the whole _render process was over. The problem was that this process is asynchronous and this callback should be invoked as soon as the widgets are appended. As such, any asynchronous operation is performed before appending the content in a new function "__renderView". Task 2346540 closes odoo/odoo#60791 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_renderer.js')
-rw-r--r--addons/web/static/src/js/views/basic/basic_renderer.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_renderer.js b/addons/web/static/src/js/views/basic/basic_renderer.js
index 16ecc473915..a03b9b41a77 100644
--- a/addons/web/static/src/js/views/basic/basic_renderer.js
+++ b/addons/web/static/src/js/views/basic/basic_renderer.js
@@ -684,7 +684,7 @@ var BasicRenderer = AbstractRenderer.extend(WidgetAdapterMixin, {
if (this._isInDom) {
for (const handle in this.allFieldWidgets) {
this.allFieldWidgets[handle].forEach(widget => {
- if (widget.on_attach_callback) {
+ if (!utils.isComponent(widget.constructor) && widget.on_attach_callback) {
widget.on_attach_callback();
}
});
@@ -694,6 +694,8 @@ var BasicRenderer = AbstractRenderer.extend(WidgetAdapterMixin, {
widget.on_attach_callback();
}
});
+ // call on_attach_callback on child components (including field components)
+ WidgetAdapterMixin.on_attach_callback.call(this);
}
},
/**