summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/basic_fields.js
diff options
context:
space:
mode:
authorMOENS Alexandre <mao@odoo.com>2018-08-21 12:00:49 +0200
committerlen-odoo <35492570+len-odoo@users.noreply.github.com>2018-09-14 16:13:35 +0200
commitb83db271354ee8ecabf4a39c96f3a187dd5535d5 (patch)
tree49b07c17770352e4c5f058fc6c96ea5315c95539 /addons/web/static/src/js/fields/basic_fields.js
parent70ed882088401c093e6a1180746b5637fe96da32 (diff)
[FIX] web: JournalDashboardGraph widget crash Mk.II
Hardening of commit:995610c065bf0242cb5023cfad2940234395739e The JournalDashboardGraph requires nv, which is lazyloaded. However it requires nvd3.js which is loaded after nv.d3.js. A function called in destroy is defined by nv.d3.js, which can make the crashhappen with the right (wrong) timing. opw 1873749
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
-rw-r--r--addons/web/static/src/js/fields/basic_fields.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js
index d624651ac85..71aab9f7992 100644
--- a/addons/web/static/src/js/fields/basic_fields.js
+++ b/addons/web/static/src/js/fields/basic_fields.js
@@ -2055,7 +2055,7 @@ var JournalDashboardGraph = AbstractField.extend({
return this._super.apply(this, arguments);
},
destroy: function () {
- if ('nv' in window) {
+ if ('nv' in window && nv.utils && nv.utils.offWindowResize) {
// if the widget is destroyed before the lazy loaded libs (nv) are
// actually loaded (i.e. after the widget has actually started),
// nv is undefined, but the handler isn't bound yet anyway