From ee2b550f3c4be92b42b7a941958eb3aa2b54df66 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Tue, 13 Oct 2015 17:22:01 +0200 Subject: [PATCH] [FIX] web: radio button display empty value when change record When a selection field with widget="radio" is False, the form view display the previews value for this field. 1 - Create a selection field (ex: [("1", "1"), ("2", "2")]), and display it on a form vue. 2 - Go to the form view (all the record have False value for this field). 3 - Change the value of this field for one record. 4 - In readonly mode, all other records now wrongly display this value (still False in DB or when "edit"). #opw-652002 --- addons/web/static/src/js/view_form.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index b4d43f26b6d..2ed32ab15c2 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3300,10 +3300,8 @@ instance.web.form.FieldRadio = instance.web.form.AbstractField.extend(instance.w var self = this; this.$el.toggleClass("oe_readonly", this.get('effective_readonly')); this.$("input:checked").prop("checked", false); - if (this.get_value()) { - this.$("input").filter(function () {return this.value == self.get_value();}).prop("checked", true); - this.$(".oe_radio_readonly").text(this.get('value') ? this.get('value')[1] : ""); - } + this.$("input").filter(function () {return this.value == self.get_value();}).prop("checked", true); + this.$(".oe_radio_readonly").text(this.get('value') ? this.get('value')[1] : ""); } });