summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-05-18 10:41:00 +0200
committerAaron Bohy <aab@odoo.com>2017-05-18 13:55:46 +0200
commitabacdd97766d58312917901599c277f62bfbef3a (patch)
tree97366d63090a1761fea20f44d6d810fb5d18f636 /addons/web/static/src/xml
parent787daee41f4ccd3d02913f74fb20326d28f80e90 (diff)
[FIX] web: FieldRadio with numerical keys encoded as strings
Before this rev., the FieldRadio didn't work on selection fields with keys like "0", "1"... i.e. strings that can be converted to numerical values. This was due to an automatic conversion of those keys to their numerical value by JQuery, so when the user changed the value, an unknow key was sent to the server (e.g. 1 instead of "1"), causing a crash. This rev. changes the logic a bit so that the keys are no more written in the DOM, but their index in the selection are.
Diffstat (limited to 'addons/web/static/src/xml')
-rw-r--r--addons/web/static/src/xml/base.xml3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index b9b7caeea7d..ac463d12be1 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -729,7 +729,8 @@
<div t-if="widget.mode !== 'readonly'" t-attf-class="o_field_radio #{widget.nodeOptions.horizontal ? 'o_horizontal' : 'o_vertical'}">
<div t-foreach="widget.values" t-as="value" class="o_radio_item">
- <input type="radio" class="o_radio_input" t-att-id="widget.unique_id + '_' + value[0]" t-att-name="widget.unique_id" t-att-data-value="value[0]"/>
+ <input type="radio" class="o_radio_input" t-att-id="widget.unique_id + '_' + value[0]"
+ t-att-name="widget.unique_id" t-att-data-value="value[0]" t-att-data-index="value_index"/>
<label t-if="!widget.nodeOptions.no_radiolabel" class="o_form_label" t-att-for="widget.unique_id + '_' + value[0]"><t t-esc="value[1]"/></label>
</div>
</div>