[IMP] web: add a badge based widget for selection fields

This commit introduces a new widget to be used for selection-based fields.
Valid choices are displayed using rectangular badges and not like the
standard list. This widget is valid for selection and many2one fields
like selection or radio widgets.

Co-authored-by: Siddarth Gajjar <sga@odoo.com>
Co-authored-by: Mohammed Shekha <msh@openerp.com>
This commit is contained in:
Siddarth Gajjar
2018-05-30 15:39:15 +02:00
committed by Thibault Delavallée
co-authored by Mohammed Shekha
parent cda8bdc8b3
commit c75c2fa9e3
6 changed files with 179 additions and 0 deletions
+7
View File
@@ -792,6 +792,13 @@
<label class="o_form_label" t-att-for="id"><t t-esc="value[1]"/></label>
</div>
</t>
<t t-name="FieldSelectionBadge">
<span t-foreach="values" t-as="value" t-attf-class="o_selection_badge #{value[0] == current_value ? 'active' : ''}" t-att-data-index="value_index">
<t t-esc="value[1]"/>
</span>
</t>
<t t-name="FieldMany2One">
<t t-if="widget.mode === 'readonly'">
<a t-if="!widget.nodeOptions.no_open" class="o_form_uri" href="#"/>