From eccf6ed458e2c41cd7baf9eb7b459c7f64cfa4d5 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Tue, 4 Feb 2020 13:34:43 +0000 Subject: [PATCH] [FIX] website_links: properly attach graph widgets to the hierarchy Simple `this` instead of `self` mistake which prevents the widgets to trigger up events. closes odoo/odoo#44617 X-original-commit: 033ad6680794e037566720f35b0285e18f3d2130 Signed-off-by: Quentin Smetz (qsm) --- .../static/src/js/website_links_charts.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/website_links/static/src/js/website_links_charts.js b/addons/website_links/static/src/js/website_links_charts.js index 5afef3e1d36..1c006a7a2fe 100644 --- a/addons/website_links/static/src/js/website_links_charts.js +++ b/addons/website_links/static/src/js/website_links_charts.js @@ -171,27 +171,27 @@ publicWidget.registry.websiteLinksCharts = publicWidget.Widget.extend({ // Process all time line chart data var now = moment(); - self.charts.all_time_bar = new BarChart(this, beginDate, now, formattedClicksByDay); + self.charts.all_time_bar = new BarChart(self, beginDate, now, formattedClicksByDay); self.charts.all_time_bar.attachTo($('#all_time_clicks_chart')); // Process month line chart data beginDate = moment().subtract(30, 'days'); - self.charts.last_month_bar = new BarChart(this, beginDate, now, formattedClicksByDay); + self.charts.last_month_bar = new BarChart(self, beginDate, now, formattedClicksByDay); self.charts.last_month_bar.attachTo($('#last_month_clicks_chart')); // Process week line chart data beginDate = moment().subtract(7, 'days'); - self.charts.last_week_bar = new BarChart(this, beginDate, now, formattedClicksByDay); + self.charts.last_week_bar = new BarChart(self, beginDate, now, formattedClicksByDay); self.charts.last_week_bar.attachTo($('#last_week_clicks_chart')); // Process pie charts - self.charts.all_time_pie = new PieChart(this, _clicksByCountry); + self.charts.all_time_pie = new PieChart(self, _clicksByCountry); self.charts.all_time_pie.attachTo($('#all_time_countries_charts')); - self.charts.last_month_pie = new PieChart(this, _lastMonthClicksByCountry); + self.charts.last_month_pie = new PieChart(self, _lastMonthClicksByCountry); self.charts.last_month_pie.attachTo($('#last_month_countries_charts')); - self.charts.last_week_pie = new PieChart(this, _lastWeekClicksByCountry); + self.charts.last_week_pie = new PieChart(self, _lastWeekClicksByCountry); self.charts.last_week_pie.attachTo($('#last_week_countries_charts')); var rowWidth = $('#all_time_countries_charts').parent().width();