diff options
| author | Mohammed Shekha <msh@odoo.com> | 2020-03-12 10:28:30 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2020-03-24 08:02:13 +0000 |
| commit | 5353fb249609e89485a63d06d4f2088b6a9d307d (patch) | |
| tree | bdbbe35844c1fe295f6c022f1cb6ec8ef1791a78 /addons/web/static/src/js/fields/basic_fields.js | |
| parent | efd5401ee1efbdd388d9623d59a96353e93bf21d (diff) | |
[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) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
| -rw-r--r-- | addons/web/static/src/js/fields/basic_fields.js | 14 |
1 files changed, 14 insertions, 0 deletions
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 |
