From 5353fb249609e89485a63d06d4f2088b6a9d307d Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Thu, 12 Mar 2020 10:28:30 +0000 Subject: [IMP] web: trim FieldEmail widget value before this commit, email widget was not trimming value and due to which space aroung email value remain as it is added by user. after this commit, email widget will trim the value and remove leading/trailing space. task-2197432 closes odoo/odoo#47470 Signed-off-by: Aaron Bohy (aab) --- addons/web/static/src/js/fields/basic_fields.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 9bdf4bc62a1..879ee978220 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1506,6 +1506,20 @@ var FieldEmail = InputField.extend({ this.$el.text(''); } }, + /** + * Trim the value input by the user. + * + * @override + * @private + * @param {any} value + * @param {Object} [options] + */ + _setValue: function (value, options) { + if (this.field.trim) { + value = value.trim(); + } + return this._super(value, options); + }, //-------------------------------------------------------------------------- // Handlers -- cgit v1.2.3