summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/basic_fields.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-11-16 17:55:37 +0100
committerChristophe Simonis <chs@odoo.com>2017-11-16 17:55:37 +0100
commitc703a2a0c35903082df671a0c0230d308353c600 (patch)
tree4e20809d577e16b51bcc73897bb85a56bd94e453 /addons/web/static/src/js/fields/basic_fields.js
parent74d9ff5bd744590c4fc0d671fee8680f438de20b (diff)
parentd279a3e6d579a695b19eb6f3fcf2ac48a16ca055 (diff)
[MERGE] forward port branch 11.0 up to d279a3e6d57
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
-rw-r--r--addons/web/static/src/js/fields/basic_fields.js7
1 files changed, 6 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 817c76323d5..a4979848adb 100644
--- a/addons/web/static/src/js/fields/basic_fields.js
+++ b/addons/web/static/src/js/fields/basic_fields.js
@@ -2023,7 +2023,12 @@ var JournalDashboardGraph = AbstractField.extend({
return this._super.apply(this, arguments);
},
destroy: function () {
- nv.utils.offWindowResize(this._onResize);
+ if ('nv' in window) {
+ // 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
+ nv.utils.offWindowResize(this._onResize);
+ }
this._super.apply(this, arguments);
},