Allow to set an additional css class to fields in form view.
Use case : you may highlight some fields for training purpose
auto_awesome What this module does
AI-generated from the code · Odoo 16.0This module lets developers highlight specific fields on any Odoo form by adding CSS classes (like background colours) to them, useful for training or drawing attention to important fields.
This is a technical tool for Odoo developers rather than an end-user feature. It changes how form views are built: when Odoo loads a form, the module can automatically add extra style classes to chosen fields.
- Developers define which fields get which style by extending a method on the
basemodel and returning a dictionary that maps a model name to style classes and field names. - The module then modifies the form view definition so those fields carry the requested CSS class, for example a coloured background.
- It validates the dictionary structure and raises a validation error if the expected format is not respected, helping developers catch mistakes early.
- It only acts on form views; other view types are left untouched.
There are no menus, buttons, reports or scheduled actions added. The demo code shows an example where, under a specific context, fields on the user form such as login, type and partner_id receive background styles. In short, it is a developer-facing customisation hook, not a business feature.
Depends on
Models and fields (1)
- base · extends an existing model
Text generated by AI (DeepSeek) from reading the Odoo 16.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 1 confirmed, 8 with no information of 9 versions.
Sources · Odoo 16.0
Confirmed on 2026-11-03 in branch 16.0 of OCA/web.
terminal Installation and usage
OCA documentation · Odoo 16.0Configuration
Source · Odoo 16.0Override _get_field_styles() with a dict of fields list per model
class Base(models.AbstractModel):
_inherit = "base"
def _get_field_styles(self):
res = super()._get_field_styles()
res["product.product"] = {
"my-css-class1": ["field1", "field2"],
"my-css-class2": ["field3"],
}
return resNo verified information in OCA: Installation, Usage.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.