コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
12029 ビュー

Hi Guys,

I'm using OpenERP 7 & want to add background color to specific rows in a tree view, based on certain value of a field.

Ex: Suppose say I have name, phone, status fields in my model. Then I want to color code my rows in a tree view, based on the value of status field. If status is Single, the row will be RED, If status is Married, the row will be Green etc..

Please help me on this. Any help would be appreciated :)

Cheers

ASP:)

アバター
破棄

*Hi, add this in your xml file...* <tree string="Sample" colors="red:state=='single';green:state=='married' "> <field name="title" string="Name"/> </tree>

最善の回答

Hi, use the below code...

In py file

'status' : fields.selection([('single','Single'),('married','Married')],'Status?'),

In xml file

<tree string="Status" colors="red:shop=='single';green:shop=='married' ">
    <field name="name"></field>
    <field name="status"></field>
</tree>
アバター
破棄
関連投稿 返信 ビュー 活動
0
3月 15
3988
2
10月 24
12565
3
10月 17
17031
0
3月 15
7155
1
3月 15
6303