summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-06-29 11:46:46 +0200
committerAaron Bohy <aab@odoo.com>2017-06-29 14:58:04 +0200
commit8473bde80e6609d552af8b00396c72a20bd3c47f (patch)
treee31d77429533eb4199ca2a8a49df9588c82e01b6 /addons/web/static/src/xml
parentb954cd64835eb2c251ba0890293079b7bcebd460 (diff)
[FIX] web: handle 'domain' key returned by onchanges
Onchange RPCs return an object that may contain a 'domain' key. When it does, its value is an object whose keys are field names and values are the new domain for the corresponding field. Before this rev., the 'domain' key was totally ignored by the BasicModel. This feature is used for example in the account.payment form view (go to an open invoice, click on 'Register payment'): the domain of field payment_method_id is updated by the onchanges (e.g. when changing the journal_id). As the domain was ignored, it always displayed all possible payment methods.
Diffstat (limited to 'addons/web/static/src/xml')
-rw-r--r--addons/web/static/src/xml/base.xml14
1 files changed, 5 insertions, 9 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index bcc832c822c..06e6b8b2285 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -724,15 +724,11 @@
t-att-autofocus="widget.attrs.autofocus"
t-att-id="widget.idForLabel"/>
</t>
-<t t-name="FieldRadio">
- <span t-if="widget.mode === 'readonly'"/>
-
- <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]" 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>
+<t t-name="FieldRadio.button">
+ <div class="o_radio_item">
+ <input type="radio" class="o_radio_input" t-att-checked="checked ? true : undefined"
+ t-att-data-value="value[0]" t-att-data-index="index" t-att-id="id"/>
+ <label class="o_form_label" t-att-for="id"><t t-esc="value[1]"/></label>
</div>
</t>
<t t-name="FieldMany2One">