summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2017-05-03 14:01:09 +0200
committerChristophe Matthieu <chm@odoo.com>2017-05-04 17:19:25 +0200
commit9ba0767f983763895ad1655184cffce6ffa0e027 (patch)
tree3b0e7c502684228dda20dde4b8b76662327359c6 /addons/web/static/src/js/fields
parent5dd23f7de22cb6302f701d7fa8e7afffc52686f0 (diff)
[FIX] web: unable to open User FormView from Settings
Uncaught TypeError: Cannot read property 'split' of undefined. Crash when the value of widget 'timezone_mismatch' is false in form view.
Diffstat (limited to 'addons/web/static/src/js/fields')
-rw-r--r--addons/web/static/src/js/fields/special_fields.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web/static/src/js/fields/special_fields.js b/addons/web/static/src/js/fields/special_fields.js
index 7f4c7378882..69647902afe 100644
--- a/addons/web/static/src/js/fields/special_fields.js
+++ b/addons/web/static/src/js/fields/special_fields.js
@@ -71,6 +71,7 @@ var FieldTimezoneMismatch = FieldSelection.extend({
// we need to clean the warning to have maximum one alert
this.$el.last().filter('.o_tz_warning').remove();
this.$el = this.$el.first();
+ var value = this.$el.val();
if (this.$option) {
this.$option.html(this.$option.html().split(' ')[0]);
@@ -78,7 +79,7 @@ var FieldTimezoneMismatch = FieldSelection.extend({
var userOffset = this.recordData.tz_offset;
this.mismatch = false;
- if (userOffset) {
+ if (userOffset && value !== "" && value !== "false") {
var offset = -(new Date().getTimezoneOffset());
var browserOffset = (offset < 0) ? "-" : "+";
browserOffset += _.str.sprintf("%02d", Math.abs(offset / 60));
@@ -92,7 +93,6 @@ var FieldTimezoneMismatch = FieldSelection.extend({
$span.attr('title', _t("Timezone Mismatch : The timezone of your browser doesn't match the selected one. The time in Odoo is displayed according to your field timezone."));
this.$el = this.$el.add($span);
- var value = this.$el.val();
this.$option = this.$('option').filter(function () {
return $(this).attr('value') === value;
});