Hi,
I want to in a form view have a field that depending on his value changes the color.
If is diferent than zero I want this number to show in red color , if it is zero I want the field to be green.
I've tried this way , but nothing happens.
<form string="Sales Order"> <sheet> <notebook> <page name="SO_payment"> <group class="oe_subtotal_footer oe_right" colspan="2" name="payment_total"> <div class="oe_subtotal_footer_separator oe_inline o_td_label"> <label for="to_pay" /> </div> <field name="to_pay" nolabel="1" class="oe_subtotal_footer_separator" widget='monetary' options="{'currency_field': 'currency_id'}" colors="{'red':to_pay>0}"/> </group> </page></notebook></sheet></form>
I just want the number to have the color.
Thanks
you want only field name="to_pay" color or all fields color.
I've updated the question.
This Odoo app allows users to dynamically change the background and text color of any integer field based on a threshold value. The app introduces a customizable widget that automatically adjusts the visual representation of integer fields, allowing users to define their own colors for values below and above the threshold. Whether for financial figures, performance metrics, or other numeric values, users can easily tailor the display according to their preferences.
https://apps.odoo.com/apps/modules/17.0/mh_integer_field_color_widget