summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorLucas Perais (lpe) <lpe@odoo.com>2018-10-24 13:35:52 +0000
committerLucas Perais (lpe) <lpe@odoo.com>2018-10-29 08:36:33 +0000
commiteaedfe40747dbc6c840a02a2c07db7257196eb45 (patch)
treeb2eb1c3e0edea8293f7b703eb00d441ef8dabd3b /addons/web/static/src/js
parente6bb3eb3e00b788a06b1757c8df534514267e5cb (diff)
[FIX] web: display of timezone mismatch select widget
On the user's preference, change the timezone to one that is different from the browser. Save the form. Go back to the user's preferences. Before this commit, every timezone was displayed inside the span that contain the warning icon, and leaked everywhere on the form view. This was because of the joint action effects of commits: 86897ca167338ca434e62827fa09f44ddbce324c 4dfabb8f7adde06a7936502af61534c9958ed4f7 Which provoked the field to be re-rendered in edit mode, but with an $el on which a span was added. `<option/>` elements were then added to both `<select>` and `<span>` This did not happen before v12.0 After this commit, there is no display glitch OPW 1895088 closes odoo/odoo#28108
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/fields/special_fields.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/addons/web/static/src/js/fields/special_fields.js b/addons/web/static/src/js/fields/special_fields.js
index 5a6aa8cfd28..90c4f589989 100644
--- a/addons/web/static/src/js/fields/special_fields.js
+++ b/addons/web/static/src/js/fields/special_fields.js
@@ -100,6 +100,25 @@ var FieldTimezoneMismatch = FieldSelection.extend({
this._renderDateTimeTimezone();
}
},
+ /**
+ * @override
+ * @private
+ * this.$el can have other elements than select
+ * that should not be touched
+ */
+ _renderEdit: function () {
+ // FIXME: hack to handle multiple root elements
+ // in this.$el , which is a bad idea
+ // In master we should make this.$el a wrapper
+ // around multiple subelements
+ var $otherEl = this.$el.not('select');
+ this.$el = this.$el.first();
+
+ this._super.apply(this, arguments);
+
+ $otherEl.insertAfter(this.$el);
+ this.$el = this.$el.add($otherEl);
+ },
});
var FieldReportLayout = relational_fields.FieldMany2One.extend({