diff options
| author | Aaron Bohy <aab@odoo.com> | 2020-04-29 07:21:38 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2020-05-05 10:05:12 +0000 |
| commit | df4693e7ffe8082335355b9a7c573d1038547f89 (patch) | |
| tree | d611e954c8b1961107f5e644545d6429348c106d /addons/web/static/src/xml/base.xml | |
| parent | 4f8860e5038711c0da5b26584c4b72663908ddbc (diff) | |
[IMP] web: add Many2OneAvatar field widget
In readonly, this widget displays the image of the related record
next to its display_name. In edit, it behaves exactly like the
regular many2one.
Part of task 2195254
Diffstat (limited to 'addons/web/static/src/xml/base.xml')
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index b06b8402620..3abde74ac51 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1346,6 +1346,12 @@ <button type="button" t-if="!widget.noOpen" class="fa fa-external-link btn btn-secondary o_external_button" tabindex="-1" draggable="false" aria-label="External link" title="External link"/> </div> </t> + +<t t-name="web.Many2OneAvatar"> + <img t-att-src="url" t-att-alt="value" class="o_m2o_avatar"/> + <span t-esc="value"/> +</t> + <t t-name="FieldReference" t-extend="FieldMany2One"> <t t-jquery=".o_input_dropdown" t-operation="before"> <select t-att-class="'o_input o_field_widget' + (widget.nodeOptions.hide_model and ' d-none' or '')"> |
