Skip to Content
Menu
This question has been flagged
1 Reply
5811 Views

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'}"/>
Avatar
Discard
Best Answer

Guess 'colors' was removed from v8 onwards

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


Avatar
Discard

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>

Related Posts Replies Views Activity
4
May 24
10079
1
Apr 24
1566
0
Nov 23
525
1
Sep 23
572
2
Aug 23
2430