diff options
Diffstat (limited to 'doc/reference')
| -rw-r--r-- | doc/reference/javascript_reference.rst | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/reference/javascript_reference.rst b/doc/reference/javascript_reference.rst index ef41944e389..141c614f29c 100644 --- a/doc/reference/javascript_reference.rst +++ b/doc/reference/javascript_reference.rst @@ -1358,6 +1358,34 @@ Let us mention the most important ones: - the field widgets can be used outside of a view. Their API is slightly awkward, but they are designed to be standalone. +Decorations +----------- + +Like the list view, field widgets have a simple support for decorations. The +goal of decorations is to have a simple way to specify a text color depending on +the record current state. For example, + +.. code-block:: xml + + <field name="state" decoration-danger="amount < 10000"/> + +The valid decoration names are: + +- decoration-bf +- decoration-it +- decoration-danger +- decoration-info +- decoration-muted +- decoration-primary +- decoration-success +- decoration-warning + +Each decoration *decoration-X* will be mapped to a css class *text-X*, which is +a standard bootstrap css class (except for *text-it* and *text-bf*, which are +handled by odoo and correspond to italic and bold, respectively). Note that the +value of the decoration attribute should be a valid python expression, which +will be evaluated with the record as evaluation context. + Non relational fields --------------------- |
