[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
This commit is contained in:
Aaron Bohy
2020-05-05 08:48:34 +00:00
parent 56787d5878
commit 1d6e4948d2
8 changed files with 130 additions and 0 deletions
+13
View File
@@ -2028,6 +2028,19 @@ order.
- Supported field types: *char, text*
- badge (FieldBadge)
Displays the value inside a bootstrap badge pill.
- Supported field types: *char*, *selection*, *many2one*
By default, the badge has a lightgrey background, but it can be customized
by using the decoration-X mechanism. For instance, to display a red badge
under a given condition:
.. code-block:: xml
<field name="foo" widget"badge" decoration-danger="state == 'cancel'"/>
Relational fields
-----------------