summaryrefslogtreecommitdiff
path: root/doc/reference
diff options
context:
space:
mode:
authorJulien Mougenot <jum@odoo.com>2020-07-14 11:50:25 +0000
committerJulien Mougenot <jum@odoo.com>2020-08-04 08:25:37 +0000
commitf21dc0c84bb8b1b5e1c4c9adfb96081182651ba4 (patch)
treea3fa76eb7756ca5204fa6c07fcf808d292f8f17a /doc/reference
parent2c9d14cfa3b18dc5a437b5497e7b1b54857b9c94 (diff)
[DOC] doc: Document "today" and "now" in context
Documentation of the affected blocks have been updated to inform about the contents of the "today" and "now" context values. closes odoo/odoo#54438 Related: odoo/enterprise#11831 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'doc/reference')
-rw-r--r--doc/reference/views.rst24
1 files changed, 16 insertions, 8 deletions
diff --git a/doc/reference/views.rst b/doc/reference/views.rst
index 479431d6018..4aa729c4235 100644
--- a/doc/reference/views.rst
+++ b/doc/reference/views.rst
@@ -97,16 +97,20 @@ an impact on all view types.
Disable/enable record duplication on the view through the **Action** dropdown.
-* ``decoration-$`` (``list`` & ``gantt``)
+* ``decoration-{$name}`` (``list`` & ``gantt``)
Define a conditional display of a record in the style of a row's text based on the corresponding
record's attributes.
Values are Python expressions. For each record, the expression is evaluated
- with the record's attributes as context values and, if ``true``, the
- corresponding style is applied to the row. Other context values are
- ``uid`` (the id of the current user) and ``current_date`` (the current date
- as a string of the form ``YYYY-MM-DD``).
+ with the record's attributes as context values and if ``true``, the
+ corresponding style is applied to the row. Here are some of the other values
+ available in the context:
+
+ * ``uid``: the id of the current user,
+ * ``today``: the current local date as a string of the form ``YYYY-MM-DD``,
+ * ``now``: same as ``today`` with the addition of the current time.
+ This value is formatted as ``YYYY-MM-DD hh:mm:ss``.
.. code-block:: xml
@@ -930,9 +934,13 @@ take the following attributes:
Values are Python expressions. For each record, the expression is evaluated
with the record's attributes as context values and if ``true``, the
- corresponding style is applied to the row. Other context values are
- ``uid`` (the id of the current user) and ``current_date`` (the current date
- as a string of the form ``yyyy-MM-dd``).
+ corresponding style is applied to the row. Here are some of the other values
+ available in the context:
+
+ * ``uid``: the id of the current user,
+ * ``today``: the current local date as a string of the form ``YYYY-MM-DD``,
+ * ``now``: same as ``today`` with the addition of the current time.
+ This value is formatted as ``YYYY-MM-DD hh:mm:ss``.
``{$name}`` can be one of the following `bootstrap contextual color`_ (``danger``,
``info``, ``secondary``, ``success`` or ``warning``).