summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_renderer.js
diff options
context:
space:
mode:
authorMathieu Duckerts-Antoine <dam@odoo.com>2020-06-26 12:29:17 +0000
committerMathieu Duckerts-Antoine <dam@odoo.com>2020-06-30 09:12:11 +0000
commit141aaa2db1414ec261902f5663ae43e4458d3955 (patch)
tree2f754f7f6fec399c5e8d0ed912d23b2347cd5840 /addons/web/static/src/js/views/basic/basic_renderer.js
parenta80ace565448398363367d32cf74b9e59956dbe9 (diff)
[FIX] web: renderers with a pie chart can reload
The on_attach_callback methods on the widgets (comming from a tag 'widget') of a form renderer were not called at an appropriate time. They were not called at all or called before the widgets were actually in the dom. This was made manifest in the dashboards that generally use pie charts widgets. Each time a pie chart widget is renderered, a new canvas with a unique id is created. The above mentioned problem explains why Chart.js was not able to acquire the canvas contexts: they are obtained by looking for a specific id in the dom. The present commit fixes that problem by doing in the class FormRenderer what was already done correctly in the child class DashboardRenderer and remove the unapropriate calls to on_attach_callback in _renderWidget. Task ID: 2278717 closes odoo/odoo#53853 X-original-commit: 7641c7074616b4375f1eb4f1fcb5a96e2ed39f94 Related: odoo/enterprise#11537 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.js3
1 files changed, 0 insertions, 3 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 9daa9c9936a..d0778ded0fd 100644
--- a/addons/web/static/src/js/views/basic/basic_renderer.js
+++ b/addons/web/static/src/js/views/basic/basic_renderer.js
@@ -802,9 +802,6 @@ var BasicRenderer = AbstractRenderer.extend(WidgetAdapterMixin, {
self._registerModifiers(node, record, widget);
widget.$el.addClass('o_widget');
$el.replaceWith(widget.$el);
- if (self._isInDom && widget.on_attach_callback) {
- widget.on_attach_callback();
- }
});
return $el;