From 018b2bbc4490bed4d31587965f6911d83594e307 Mon Sep 17 00:00:00 2001 From: Andreas Zoellner Date: Mon, 21 Nov 2016 12:10:59 +0100 Subject: [PATCH] [FIX] 7.0 Fix JavaScript error: undefined variable 'widget.view' This fixes #466 --- web_m2x_options/static/src/js/form.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js index 23bab44e..eec7142e 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -37,11 +37,11 @@ openerp.web_m2x_options = function (instance) { if (p < 0) return; var key = option.substring(p + 1); // w/o 'web_m2x_options' prefix // ... hence set from context ... - if (!_.isUndefined(widget.view.dataset.context[key])) { + if (!_.isUndefined(widget.view) && !_.isUndefined(widget.view.dataset.context[key])) { widget.view.ir_options[option] = widget.view.dataset.context[key]; } // ... and (overwrite) from widget here ... - if (!_.isUndefined(widget.options[key])) { + if (!_.isUndefined(widget.view) && !_.isUndefined(widget.options[key])) { widget.view.ir_options[option] = widget.options[key]; } // ... but don't overwrite from global parameters above