i want to change the color and size text of an field inside the form view depending on the state , in know there is a possiblity to do so in tree view ,but how we can do the same in the form view ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Účetnictví
- Sklad
- PoS
- Project
- MRP
This question has been flagged
Hi,
You can change the color and other css attributes of a field on the form view by using ‘style’ attribute inside fields. And if you want to show the colors or other attributes based on state you can use invisible attribute for the fields as like mentioned below.
<field name="test_field" style="background-color:red;font-size:60px;color:yellow;" attrs="{'invisible': [('state', '=', 'draft')]}"/>
<field name="test_field" style="background-color:red;font-size:60px;color:yellow;" attrs="{'invisible': [('state', '=', 'sale')]}"/>
Regards
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Přihlásit se
hi, did you find any solution for this?
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