From 414ad99a922deac45aaaf8ee3da9b1bea3341d29 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 10 Aug 2016 09:52:19 +0200 Subject: [PATCH] [FIX] web: unchecked radio button Before rendering the radio button, the radio button must be unchecked to ensure to take the last value checked. Step to reproduce: -From main menu, click on 'Contacts' -Click on 'Create' -Select 'Company' value on company_type field -Save or not the contact -Return in the main contact view (click on breadcrumbs) -Click on 'Create' Bug: The default value on company_type field is 'Company' but the fields that should be hidden are visible (example : parent_id field) After the fix: The value of company_type field is 'individual' opw:684847 --- addons/web/static/src/js/views/form_widgets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/views/form_widgets.js b/addons/web/static/src/js/views/form_widgets.js index d127120a120..512113f3127 100644 --- a/addons/web/static/src/js/views/form_widgets.js +++ b/addons/web/static/src/js/views/form_widgets.js @@ -1068,7 +1068,7 @@ var FieldRadio = common.AbstractField.extend(common.ReinitializeFieldMixin, { render_value: function () { var self = this; this.$el.toggleClass("oe_readonly", this.get('effective_readonly')); - this.$("input").filter(function () {return this.value == self.get_value();}).prop("checked", true); + this.$("input").prop("checked", false).filter(function () {return this.value == self.get_value();}).prop("checked", true); this.$(".oe_radio_readonly").text(this.get('value') ? this.get('value')[1] : ""); } });