Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
7 Trả lời
5047 Lượt xem


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Use 'decoration' attribute

Try these:

decoration-bf - shows the line in BOLD

decoration-it - shows the line in ITALICS

decoration-danger - shows the line in LIGHT RED

decoration-info - shows the line in LIGHT BLUE

decoration-muted - shows the line in LIGHT GRAY

decoration-primary - shows the line in LIGHT PURPLE

decoration-success - shows the line in LIGHT GREEN

decoration-warning - shows the line in LIGHT BROWN

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

use colors attribute in tree view .

<tree string="My tree View" colors="red:state in ['cancel','close'];#64B5F6:state=='running';#0D47A1:state=='extend';green:state=='complete';#FF4081:state=='finish'" >   
Ảnh đại diện
Huỷ bỏ
Tác giả

colors aren't works in odoo 9 version

Tác giả

odoo 9 use Decoration to indicate colors in tree..

<tree string="Session Tree" decoration-info="age&lt;2" decoration-danger="age&gt;10">

@Annadurai Actually both colors & decoration can be used.

I can confirm colors to be working for me on Odoo 9

Tác giả Câu trả lời hay nhất

<tree string="Session Tree" decoration-info="age&lt;2" decoration-danger="age&gt;10"> 
 for V9 they changed it to Decoration

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

in v8 color attributes are working well but in v9 its deprecated instead they using decoration 

example 

<tree decoration-success>

 have a look on color in the below link

https://www.odoo.com/documentation/9.0/reference/views.html#lists

Ảnh đại diện
Huỷ bỏ