From 1c8ca666c78792f0895e83960f8ea68a2d23b94a Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Tue, 11 Aug 2015 16:17:36 +0200 Subject: [PATCH] [REF] *: tree: use semantics decoration-{class} attributes instead of deprecated colors and fonts attributes --- addons/account/views/account_payment_view.xml | 2 +- addons/crm/crm_lead_view.xml | 2 +- .../hr_equipment/views/hr_equipment_views.xml | 4 ++-- .../views/sale_contract_view.xml | 2 +- addons/stock/stock_view.xml | 6 ++--- doc/howtos/backend.rst | 24 ++++++++++++++----- 6 files changed, 26 insertions(+), 14 deletions(-) diff --git a/addons/account/views/account_payment_view.xml b/addons/account/views/account_payment_view.xml index bf2d36486bb..f35c3ff25ce 100644 --- a/addons/account/views/account_payment_view.xml +++ b/addons/account/views/account_payment_view.xml @@ -25,7 +25,7 @@ account.supplier.payment.tree account.payment - + diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 8880876962f..e61b4478383 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -667,7 +667,7 @@ crm.lead.next.activity.tree crm.lead - + diff --git a/addons/hr_equipment/views/hr_equipment_views.xml b/addons/hr_equipment/views/hr_equipment_views.xml index ebec9eb7c8d..83258980a8f 100644 --- a/addons/hr_equipment/views/hr_equipment_views.xml +++ b/addons/hr_equipment/views/hr_equipment_views.xml @@ -133,7 +133,7 @@ hr.equipment.request.tree hr.equipment.request - + @@ -313,7 +313,7 @@ hr.equipment.tree hr.equipment - + diff --git a/addons/sale_contract/views/sale_contract_view.xml b/addons/sale_contract/views/sale_contract_view.xml index d55d7a00769..d5a35506127 100644 --- a/addons/sale_contract/views/sale_contract_view.xml +++ b/addons/sale_contract/views/sale_contract_view.xml @@ -242,7 +242,7 @@ account.analytic.account - + diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index e1168f931ab..4caf8335028 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -731,7 +731,7 @@ - + @@ -756,7 +756,7 @@ - + @@ -1165,7 +1165,7 @@ stock.move - + diff --git a/doc/howtos/backend.rst b/doc/howtos/backend.rst index 45b02c60e80..77b8c1ed176 100644 --- a/doc/howtos/backend.rst +++ b/doc/howtos/backend.rst @@ -974,19 +974,31 @@ Tree views can take supplementary attributes to further customize their behavior: ``colors`` - mappings of colors to conditions. If the condition evaluates to ``True``, - the corresponding color is applied to the row: + .. deprecated:: 9.0 + replaced by ``decoration-{$name}`` + +``decoration-{$name}`` + allow changing 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``). + + ``{$name}`` can be ``bf`` (``font-weight: bold``), ``it`` + (``font-style: italic``), or any bootstrap contextual color (``danger``, + ``info``, ``muted``, ``primary``, ``success`` or ``warning``). .. code-block:: xml - + - Clauses are separated by ``;``, the color and condition are separated by - ``:``. - ``editable`` Either ``"top"`` or ``"bottom"``. Makes the tree view editable in-place (rather than having to go through the form view), the value is the