跳至内容
菜单
此问题已终结
1 回复
7275 查看

i am trying like this but not able to get colors.

<field name="state" widget="statusbar"
statusbar_visible="make_draft,draft,book,normal,close,sold,cancel,block,upcoming"
colors='{"draft":"red","make_draft":"red" "normal":"blue", "close":"red","sold":"green","cancle":"black"}'
options="{'clickable': '1', 'fold_field': 'fold','select':'1'}"/>
形象
丢弃
最佳答案

Guess 'colors' was removed from v8 onwards

https://github.com/odoo/odoo/issues/5987


形象
丢弃

Try

<form string="allocation_form">

<style>

.o_form_view .o_form_statusbar > .o_statusbar_status > .o_arrow_button.btn-primary.disabled[data-value="draft"] {

background: blue;

}

.o_form_view .o_form_statusbar > .o_statusbar_status >

.o_arrow_button.btn-primary.disabled[data-value="draft"]::after {

border-left-color: blue;

}

.o_form_view .o_form_statusbar > .o_statusbar_status > .o_arrow_button.btn-primary.disabled[data-value = "cancel"] {

background: green;

}

.o_form_view .o_form_statusbar > .o_statusbar_status > .o_arrow_button.btn-primary.disabled[data-value =

"cancel"]::after {

border-left-color: green;

}

</style>

<header>

<field name="state" widget="statusbar" statusbar_visible="draft,cancel"/>

</header>

相关帖文 回复 查看 活动
4
5月 24
12610
1
4月 24
3245
0
11月 23
1990
1
9月 23
2081
2
8月 23
4472