summaryrefslogtreecommitdiff
path: root/addons/website/static/src
diff options
context:
space:
mode:
authorRomainLibert <rli@odoo.com>2019-08-26 10:52:27 +0000
committerRomainLibert <rli@odoo.com>2019-08-28 11:13:18 +0000
commit6aaef4a3d95a9c2eeae698bda6a4082470e82a48 (patch)
treee3d05b9a756356558220a2a02f319f1375debae0 /addons/website/static/src
parent85b5c9bbb4c558dec56de3351763496fc9e8fb1e (diff)
[FIX] website: fix ctx argument
In the call to Chart.js we pass a ctx which should be a DOM element, however we pass `null` as the ctx. It seems that what happens is that we look for the DOM element inside the `document` (via getElementById) but this element is not yet inserted into the document, hence this returns `null`. Since we already have a reference to the canvas element which should be used as ctx, we can probably just reuse this reference closes odoo/odoo#36072 Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Diffstat (limited to 'addons/website/static/src')
-rw-r--r--addons/website/static/src/js/backend/dashboard.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website/static/src/js/backend/dashboard.js b/addons/website/static/src/js/backend/dashboard.js
index dda40102904..28b9a55c8a4 100644
--- a/addons/website/static/src/js/backend/dashboard.js
+++ b/addons/website/static/src/js/backend/dashboard.js
@@ -185,7 +185,7 @@ var Dashboard = AbstractAction.extend({
};
});
- var ctx = document.getElementById(chart_id);
+ var ctx = this.$canvas[0];
this.chart = new Chart(ctx, {
type: 'line',
data: {