summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2021-02-01 19:30:28 +0000
committerAaron Bohy <aab@odoo.com>2021-02-01 20:12:42 +0000
commit8b014a57a1930dfc69f14254564af8a43eff9845 (patch)
treef76248fef0167e4dcb6d7a94740a2269aed875a3 /addons/web/static/src
parent9c9c4117ccc705dc47a67f659425de67e200542f (diff)
[FIX] web: FieldRadio: getFocusableElement defined twice
Commit [1] adds an override of the getFocusableElement of AbstractField in FieldRadio, but this function was already defined. Even though it doesn't crash, this is obviously not something to do. This commit removes the first occurence (which was overriden by the second). [1] https://github.com/odoo/odoo/commit/ebe118fc607391737adc37e18c3278a3d2c87b5e closes odoo/odoo#65372 Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/fields/relational_fields.js18
1 files changed, 5 insertions, 13 deletions
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js
index 55ed1ecb731..01d4332ee36 100644
--- a/addons/web/static/src/js/fields/relational_fields.js
+++ b/addons/web/static/src/js/fields/relational_fields.js
@@ -3046,11 +3046,14 @@ var FieldRadio = FieldSelection.extend({
//--------------------------------------------------------------------------
/**
+ * Returns the currently-checked radio button, or the first one if no radio
+ * button is checked.
+ *
* @override
- * @returns {jQuery}
*/
getFocusableElement: function () {
- return this.mode === 'edit' && this.$input || this.$el;
+ var checked = this.$("[checked='true']");
+ return checked.length ? checked : this.$("[data-index='0']");
},
/**
@@ -3062,17 +3065,6 @@ var FieldRadio = FieldSelection.extend({
},
/**
- * Returns the currently-checked radio button, or the first one if no radio
- * button is checked.
- *
- * @override
- */
- getFocusableElement: function () {
- var checked = this.$("[checked='true']");
- return checked.length ? checked : this.$("[data-index='0']");
- },
-
- /**
* Associates the 'for' attribute to the radiogroup, instead of the selected
* radio button.
*