From 9e6c616130622eabc5a43f84eca80c6326ded20b Mon Sep 17 00:00:00 2001 From: Martin Geubelle Date: Wed, 11 Apr 2018 17:19:45 +0200 Subject: [FIX] web: focus select in reference widget In the reference widget, the focus was always on the input (many2one) even though the first select (with the model) was not set. Thanks to @kaerdsar for the original PR. Partially closes #24070 --- addons/web/static/src/js/fields/relational_fields.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'addons/web/static/src/js/fields') diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index bc44d6b659a..5c670e11c73 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -2280,6 +2280,21 @@ var FieldReference = FieldMany2One.extend({ return this._super.apply(this, arguments); }, + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + /** + * @override + * @returns {jQuery} + */ + getFocusableElement: function () { + if (this.mode === 'edit' && !this.field.relation) { + return this.$('select'); + } + return this._super.apply(this, arguments); + }, + //-------------------------------------------------------------------------- // Private //-------------------------------------------------------------------------- -- cgit v1.2.3 From 05589db8232a68846cca2660c73914045b1fec5a Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Fri, 13 Apr 2018 15:22:47 +0200 Subject: [FIX] web: don't ignore required attrs on image fields Before this rev., falsy image fields could be saved even if they were required. --- addons/web/static/src/js/fields/basic_fields.js | 3 --- 1 file changed, 3 deletions(-) (limited to 'addons/web/static/src/js/fields') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index aff339cb4a2..ac8ad02b24a 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1227,9 +1227,6 @@ var FieldBinaryImage = AbstractFieldBinary.extend({ self.do_warn(_t("Image"), _t("Could not display the selected image.")); }); }, - isSet: function () { - return true; - }, }); var FieldBinaryFile = AbstractFieldBinary.extend({ -- cgit v1.2.3