From ba1f4dc381dc412cfbed84831bedd1af704d2ff2 Mon Sep 17 00:00:00 2001 From: Vincent Schippefilt Date: Fri, 26 Jul 2019 13:43:17 +0000 Subject: [FIX] web: fix error when image field can't load image when image field cannot load an image, it will default to the placeholder image. If this placeholder image also cannot be loaded it was creating an infinite loop errors After this commit, we only show one error if the original image cannot be downloaded and if the placeholder cannot be downloaded, we don't show anything else. closes odoo/odoo#35226 Signed-off-by: VincentSchippefilt --- addons/web/static/src/js/fields/basic_fields.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index bf1b1139998..b3bf09ab88d 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1586,8 +1586,8 @@ var FieldBinaryImage = AbstractFieldBinary.extend({ } this.$('> img').remove(); this.$el.prepend($img); + $img.one('error', function () { - self._clearFile(); $img.attr('src', self.placeholder); self.do_warn(_t("Image"), _t("Could not display the selected image.")); }); -- cgit v1.2.3 From 6d9dabd5d933c5cd6ba5a42103894d731a5689a0 Mon Sep 17 00:00:00 2001 From: Julien Castiaux Date: Thu, 25 Jul 2019 09:14:45 +0000 Subject: [FIX] web: hide dashboard tooltip on page change Go to CRM/Sales/Team Pileline. Place your cursor on the chart, a tooltip appears, move your cusror away, the tooltip disappear. Now clic anywhere on the interface so the page change (i.e. on "x Open Opportunities") and quickly while the page loads place your cursor on the tooltip, it appears but when the page change it doesn't disappear. The problem here is that the graph element is removed from the DOM which prevent the correct handling of the `mousehover` event used internally by nv.d3 to show/hide the related tooltip. The solution is to manually hide the tooltip when the graph element is removed from the DOM. opw-2042286 closes odoo/odoo#35172 Signed-off-by: Lucas Perais (lpe) --- addons/web/static/src/js/fields/basic_fields.js | 1 + 1 file changed, 1 insertion(+) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 57f7e705939..fa27ad11ab3 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -2530,6 +2530,7 @@ var JournalDashboardGraph = AbstractField.extend({ * Called when the field is detached from the DOM. */ on_detach_callback: function () { + this.chart.tooltip.hidden(true); this._isInDOM = false; }, -- cgit v1.2.3 From c687bd9aedbf00312f821db38ee7bb79cff72410 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 7 Aug 2019 16:29:42 +0200 Subject: Revert "[FIX] web: hide dashboard tooltip on page change" Mow that the Journal Dashboard use Chart.js, this patch is unneeded. This reverts commit 6d9dabd5d933c5cd6ba5a42103894d731a5689a0. Oversight of previous forward-port. --- addons/web/static/src/js/fields/basic_fields.js | 1 - 1 file changed, 1 deletion(-) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 437543ef184..b3bf09ab88d 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -2526,7 +2526,6 @@ var JournalDashboardGraph = AbstractField.extend({ * Called when the field is detached from the DOM. */ on_detach_callback: function () { - this.chart.tooltip.hidden(true); this._isInDOM = false; }, -- cgit v1.2.3