Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
7237 Visualizações

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
Cancelar
Melhor resposta

Guess 'colors' was removed from v8 onwards

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


Avatar
Cancelar

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>

Publicações relacionadas Respostas Visualizações Atividade
4
mai. 24
12495
1
abr. 24
3123
0
nov. 23
1910
1
set. 23
2019
2
ago. 23
4405