I am trying to color of red or green based on some fields that I have in a tree view, when the view is deployed I hasnt got any problem but I would like that it also works when it is totally grouped.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
Hi,
You can set the background color of each record in the tree view
based on a condition by following these steps:
1. Define the condition in the XML file: In the XML file, within the
<tree>
element, you can set the decoration-attributes to define the condition for each background color.
<record id="sale_order_view_tree" model="ir.ui.view">
<field name="name">product.template.view.tree.inherit.sale_order</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_tree"/>
<field name="arch" type="xml">
<tree position="attributes">
<attribute name="decoration-danger">state == draft</attribute>
<attribute name="decoration-success">state== sent</attribute>
<attribute name="decoration-warning">state== sale</attribute>
</tree>
</field>
</record>
2. Add CSS styles in the CSS file:
.o_sale_order .text-success { background-color: #a7f2af7d !important;
}
.o_sale_order
.text-danger { background-color: #fb88847d !important; }
.o_sale_order
.text-warning { background-color: #fdf57d8f !important; }
Hope it helps
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
5
wrz 24
|
45286 | ||
|
0
gru 23
|
1474 | ||
|
1
maj 23
|
2984 | ||
|
1
sie 21
|
6667 | ||
|
0
mar 21
|
2123 |