[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
This commit is contained in:
Goffin Simon
2016-08-10 11:37:52 +02:00
parent b868ae51b6
commit 414ad99a92
@@ -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] : "");
}
});