diff options
| author | Christophe Matthieu <chm@openerp.com> | 2013-04-15 14:16:08 +0200 |
|---|---|---|
| committer | Christophe Matthieu <chm@openerp.com> | 2013-04-15 14:16:08 +0200 |
| commit | 97900c25a44cb4669f1e45401d69b31b88cdcd96 (patch) | |
| tree | d271a164edbcd91d95256c0d5979a4259938d88d /addons/web/static/src/xml/base.xml | |
| parent | e69326ee3b32bf50805bf1aca73d941a3bbcd2fe (diff) | |
| parent | ed46400a55401257aca6cbb6bd1a97f3b4d632a6 (diff) | |
[MERGE] radio-many2one: clean code and allow to apply radio button on many2one field
bzr revid: chm@openerp.com-20130415121608-gmis1l6djbudyez5
Diffstat (limited to 'addons/web/static/src/xml/base.xml')
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 405ee81e0cd..943326f5011 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1112,26 +1112,31 @@ </span> </t> <t t-name="FieldRadio"> - <span t-attf-class="oe_form_field oe_form_field_radio #{widget.horizontal ? 'oe_horizontal' : 'oe_vertical'}" t-att-style="widget.node.attrs.style"> - <t t-if="widget.horizontal"> - <t t-set="width" t-value="Math.floor(100 / widget.field.selection.length)"/> - <t t-if="!widget.no_radiolabel"> - <t t-foreach="widget.field.selection" t-as="selection"> - <div class="oe_radio_header" t-att-style="'width: ' + width + '%;'"><t t-esc="selection[1]"/></div> + <span t-attf-class="oe_form_field oe_form_field_radio #{widget.options.horizontal ? 'oe_horizontal' : 'oe_vertical'}" t-att-style="widget.node.attrs.style"> + <span t-if="!widget.get('effective_readonly')"> + <t t-if="widget.options.horizontal"> + <t t-set="width" t-value="Math.floor(100 / widget.selection.length)"/> + <t t-if="!widget.options.no_radiolabel"> + <t t-foreach="widget.selection" t-as="selection"> + <label t-att-for="widget.uniqueId + '_' + selection[0]" t-att-style="'width: ' + width + '%;'"><t t-esc="selection[1]"/></label> + </t> + <br/> + </t> + <t t-foreach="widget.selection" t-as="selection"> + <div t-att-style="'width: ' + width + '%;'"> + <span class="oe_radio_input"><input type="radio" t-att-name="widget.uniqueId" t-att-id="widget.uniqueId + '_' + selection[0]" t-att-value="selection[0]"/></span> + </div> </t> - <br/> - </t> - <t t-foreach="widget.field.selection" t-as="selection"> - <div class="oe_radio_input" t-att-style="'width: ' + width + '%;'" t-att-data-id="selection[0]">&nbsp;</div> </t> - </t> - <t t-if="!widget.horizontal"> - <t t-foreach="widget.field.selection" t-as="selection"> - <div class="oe_radio_header" t-att-style="'width: ' + width + '%;'" t-att-data-id="selection[0]"> - <div class="oe_radio_input">&nbsp;</div><t t-if="!widget.no_radiolabel" t-esc="selection[1]"/> - </div> + <t t-if="!widget.options.horizontal"> + <t t-foreach="widget.selection" t-as="selection"> + <div> + <span class="oe_radio_input"><input type="radio" t-att-id="widget.uniqueId + '_' + selection[0]" t-att-name="widget.uniqueId" t-att-value="selection[0]"/></span><label t-if="!widget.options.no_radiolabel" t-att-for="widget.uniqueId + '_' + selection[0]"><t t-esc="selection[1]"/></label> + </div> + </t> </t> - </t> + </span> + <span t-if="widget.get('effective_readonly')" class="oe_radio_readonly"><t t-esc="widget.get('value')[1]"/></span> </span> </t> <t t-name="FieldMany2One"> |
