diff options
| author | Aaron Bohy <aab@odoo.com> | 2020-04-29 07:21:34 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2020-05-05 08:48:34 +0000 |
| commit | 1d6e4948d2e8534379b6815e931a6eaa58955e18 (patch) | |
| tree | 587a061ffa02f6797383b26b020139d61bb3fde5 /addons/web/static/src/xml | |
| parent | 56787d587858760355e6703f1afce54a66f7800f (diff) | |
[IMP] web: add BadgeField component
This new field component displays the field's value inside a
bootstrap pill badge. Supported field types are 'char', 'selection'
and 'many2one'. The background color of the badge can be customized
by using the decoration-xxx mechanism, e.g.
<field name="state" decoration-danger="state == 'cancel'" widget="badge"/>
Part of task 2195254
Diffstat (limited to 'addons/web/static/src/xml')
| -rw-r--r-- | addons/web/static/src/xml/fields.xml | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/web/static/src/xml/fields.xml b/addons/web/static/src/xml/fields.xml index ff7939f36a3..ce271ba2123 100644 --- a/addons/web/static/src/xml/fields.xml +++ b/addons/web/static/src/xml/fields.xml @@ -6,4 +6,8 @@ class="o_field_boolean" t-on-change="_onChange"/> </t> + <t t-name="web.FieldBadge" owl="1"> + <span class="badge badge-pill o_field_badge" t-esc="_formatValue(value)"/> + </t> + </templates> |
