From a8f64e6e22a2583a4d038e0fde032960cb65a58e Mon Sep 17 00:00:00 2001 From: mgh-odoo Date: Tue, 12 Mar 2019 06:09:18 +0000 Subject: [IMP] base : Timezone alert - icon displayed next to field if user haven't set timezone - added relevant tooltip - test case added for field not set alert Task: #1916132 Closes: #29448 Signed-off-by: VincentSchippefilt --- addons/web/static/src/js/fields/special_fields.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src/js/fields/special_fields.js') diff --git a/addons/web/static/src/js/fields/special_fields.js b/addons/web/static/src/js/fields/special_fields.js index 0aac16822d0..7b8e53095e1 100644 --- a/addons/web/static/src/js/fields/special_fields.js +++ b/addons/web/static/src/js/fields/special_fields.js @@ -74,6 +74,7 @@ var FieldTimezoneMismatch = FieldSelection.extend({ this.$el.last().filter('.o_tz_warning').remove(); this.$el = this.$el.first(); var value = this.$el.val(); + var $span = $(''); if (this.$option) { this.$option.html(this.$option.html().split(' ')[0]); @@ -90,15 +91,18 @@ var FieldTimezoneMismatch = FieldSelection.extend({ } if (this.mismatch){ - var $span = $(''); $span.insertAfter(this.$el); - $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 the timezone set on your user's preferences.")); + $span.attr('title', _t("Timezone Mismatch : This timezone is different from that of your browser.\nPlease, set the same timezone as your browser's to avoid time discrepancies in your system.")); this.$el = this.$el.add($span); this.$option = this.$('option').filter(function () { return $(this).attr('value') === value; }); this._renderDateTimeTimezone(); + } else if (value == "false") { + $span.insertAfter(this.$el); + $span.attr('title', _t("Set a timezone on your user")); + this.$el = this.$el.add($span); } }, /** -- cgit v1.2.3