diff options
| author | mgh-odoo <mgh@odoo.com> | 2019-03-12 06:09:18 +0000 |
|---|---|---|
| committer | Vincent Schippefilt <vsc@odoo.com> | 2019-05-31 06:58:57 +0000 |
| commit | a8f64e6e22a2583a4d038e0fde032960cb65a58e (patch) | |
| tree | c5d2034eb4d70affbfe93f5f5e494b763ea11bdb /addons/web/static/src | |
| parent | a9370e810c862a65ac598137bdb8a386cb35416e (diff) | |
[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 <VincentSchippefilt@users.noreply.github.com>
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/fields/special_fields.js | 8 | ||||
| -rw-r--r-- | addons/web/static/src/scss/form_view.scss | 2 |
2 files changed, 7 insertions, 3 deletions
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 = $('<span class="fa fa-exclamation-triangle o_tz_warning"/>'); 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 class="fa fa-exclamation-triangle o_tz_warning"/>'); $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); } }, /** diff --git a/addons/web/static/src/scss/form_view.scss b/addons/web/static/src/scss/form_view.scss index 7746742b3b1..35c5b6c5d74 100644 --- a/addons/web/static/src/scss/form_view.scss +++ b/addons/web/static/src/scss/form_view.scss @@ -557,7 +557,7 @@ color: theme-color('danger'); cursor: help; position: absolute; - margin-left: -40px; + margin-left: 10px; margin-top: 5px; } |
