summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2015-10-13 17:22:01 +0200
committerChristophe Matthieu <chm@odoo.com>2015-10-29 07:21:36 +0100
commitee2b550f3c4be92b42b7a941958eb3aa2b54df66 (patch)
tree661476f41f163256b51a7a440a61c3e14f74a560 /addons/web/static/src
parent35e9fa5c410db78fbad9492afc57b5e7c05a9cb4 (diff)
[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
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/view_form.js6
1 files 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] : "");
}
});