summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml/base.xml
diff options
context:
space:
mode:
authorMartin Geubelle <mge@odoo.com>2017-06-26 18:11:56 +0200
committerMartin Geubelle <mge@odoo.com>2017-06-28 16:53:45 +0200
commitec3bc2eeaf88c957340615ed0da71ac7b91a596b (patch)
tree292de80755badf3e1b4aa3a7c4851a1e31d389f1 /addons/web/static/src/xml/base.xml
parent157732cfb15d743c66c36a1bdcb350026a0473e4 (diff)
[FIX] web: deal with reference fields
The reference fields haven't been correctly implemented with the new views. This commit restores their behaviour. Note that an small improvement has been introduced in this commit. Before saas-16, a `name_get` was done for each record (so 80 if the field was displayed in a full list view), which is not optimal. The calls are now batched by model (so one `name_get` by model appearing in the field values).
Diffstat (limited to 'addons/web/static/src/xml/base.xml')
-rw-r--r--addons/web/static/src/xml/base.xml8
1 files changed, 8 insertions, 0 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index 774c3b9b09c..bcc832c822c 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -753,6 +753,14 @@
<button type="button" t-if="!widget.nodeOptions.no_open" class="fa fa-external-link btn btn-default o_external_button" tabindex="-1" draggable="false"/>
</div>
</t>
+<t t-name="FieldReference" t-extend="FieldMany2One">
+ <t t-jquery=".o_input_dropdown" t-operation="before">
+ <select class="o_input o_field_widget">
+ <option/>
+ <option t-foreach="widget.field.selection" t-as="model" t-att-value="model[0]"><t t-esc="model[1]"/></option>
+ </select>
+ </t>
+</t>
<t t-name="FieldMany2ManyTag">
<t t-foreach="elements" t-as="el">
<span t-attf-class="badge dropdown o_tag_color_#{el.color || 10}" t-att-data-color="el.color || 10" t-att-data-index="el_index" t-att-data-id="el.id">