[REF] *: tree: use semantics decoration-{class} attributes
instead of deprecated colors and fonts attributes
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
<field name="name">account.supplier.payment.tree</field>
|
||||
<field name="model">account.payment</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="blue:state=='draft'; #707070:state=='sent'; #A0A0A0:state=='reconciled'" edit="false">
|
||||
<tree decoration-info="state=='draft'" decoration-muted="state=='reconciled'" edit="false">
|
||||
<field name="payment_date"/>
|
||||
<field name="name"/>
|
||||
<field name="journal_id"/>
|
||||
|
||||
@@ -667,7 +667,7 @@
|
||||
<field name="name">crm.lead.next.activity.tree</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Next Activity" create="false" colors="red:date_action and (date_action < current_date)" default_order="date_action">
|
||||
<tree string="Next Activity" create="false" decoration-danger="date_action and (date_action < current_date)" default_order="date_action">
|
||||
<field name="name"/>
|
||||
<field name="date_action"/>
|
||||
<field name="next_activity_id"/>
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
<field name="name">hr.equipment.request.tree</field>
|
||||
<field name="model">hr.equipment.request</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="maintenance Request" fonts="bold:message_unread==True">
|
||||
<tree string="maintenance Request" decoration-bf="message_unread==True">
|
||||
<field name="message_unread" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="request_date" groups="base.group_no_one"/>
|
||||
@@ -313,7 +313,7 @@
|
||||
<field name="name">hr.equipment.tree</field>
|
||||
<field name="model">hr.equipment</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Assign To Employee" fonts="bold:message_unread==True">
|
||||
<tree string="Assign To Employee" decoration-bf="message_unread==True">
|
||||
<field name="message_unread" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="employee_id" string="Employee"/>
|
||||
|
||||
@@ -242,7 +242,7 @@
|
||||
<field name="model">account.analytic.account</field>
|
||||
<field eval="10" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree toolbar="1" colors="grey:state=='close';" string="Analytic Accounts">
|
||||
<tree toolbar="1" decoration-muted="state=='close'" string="Analytic Accounts">
|
||||
<field name="complete_name"/>
|
||||
<field name="manager_id"/>
|
||||
<field name="contract_type"/>
|
||||
|
||||
@@ -731,7 +731,7 @@
|
||||
<field name="recompute_pack_op" invisible="1"/>
|
||||
<field name="pack_operation_ids" invisible="1"/>
|
||||
<field name="pack_operation_product_ids" options="{'reload_on_button': True}" context="{'default_picking_id': id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id}">
|
||||
<tree editable="bottom" colors="grey:result_package_id;red:qty_done>product_qty;green:qty_done==product_qty and state!='done'">
|
||||
<tree editable="bottom" decoration-muted="result_package_id" decoration-danger="qty_done>product_qty" decoration-success="qty_done==product_qty and state!='done'">
|
||||
<field name="package_id" groups="stock.group_tracking_lot" invisible="1"/>
|
||||
<field name="product_id" on_change="product_id_change(product_id, product_uom_id, product_qty)" required="1" attrs="{'readonly': [('fresh_record', '=', False)]}"/>
|
||||
<field name="fresh_record" invisible="1"/>
|
||||
@@ -756,7 +756,7 @@
|
||||
</field>
|
||||
<field name="picking_type_entire_packs" invisible="1"/>
|
||||
<field name="pack_operation_pack_ids" options="{'reload_on_button': True}" attrs="{'invisible': [('pack_operation_pack_ids', '=', []), ('picking_type_entire_packs', '=', False)]}" context="{'default_picking_id': id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id, 'default_picking_id': id}" groups="stock.group_tracking_lot">
|
||||
<tree editable="bottom" colors="grey:qty_done>0;">
|
||||
<tree editable="bottom" decoration-muted="qty_done>0">
|
||||
<field name="package_id" required="1" string="Package To Move"/>
|
||||
<field name="picking_id" invisible="1"/>
|
||||
<field name="location_id" domain="[('id', 'child_of', parent.location_id)]" invisible="1"/>
|
||||
@@ -1165,7 +1165,7 @@
|
||||
<field name="model">stock.move</field>
|
||||
<field eval="4" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree decoration-muted="scrapped == True" colors="grey:scrapped == True" string="Stock Moves" editable="bottom">
|
||||
<tree decoration-muted="scrapped == True" string="Stock Moves" editable="bottom">
|
||||
<field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.partner_id)"/>
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="product_uom_qty" on_change="onchange_quantity(product_id, product_uom_qty, product_uom, product_uos)"/>
|
||||
|
||||
+18
-6
@@ -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
|
||||
|
||||
<tree string="Idea Categories" colors="blue:state=='draft';red:state=='trashed'">
|
||||
<tree string="Idea Categories" decoration-info="state=='draft'"
|
||||
decoration-danger="state=='trashed'">
|
||||
<field name="name"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user