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
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
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
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký
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