Processing on boolean


I would like to have a boolean field when it is true, it takes the value « validated » in green color, otherwise it takes the value « not validated » in red color. I started doing this but it doesn’t work:

In view :

<field name="state" title="State" if="state==true ? 'VALIDATED' : 'NOT VALIDATED'"/>

In Domain :

<boolean name="state" title="State"/>

I would like to be able to put green or red colors in both the form view and the gread view.

Can you help me plz. Thanks.

Try something like this :

<field name="state" title="State" colSpan="1"/>
<label name="$stateTrue" title="VALIDATED" colSpan="1" hidden="true" readonly="true" showIf="state" css="label-success" />
<label name="$stateFalse" title="NOT VALIDATED" colSpan="2" hidden="true" readonly="true" showIf="!state" css="label-danger" />
1 « J'aime »