Some of our customers asked for highlighting particular fields in particular views. At the moment this is not possible in standard OpenERP.
We created a new OpenERP module that will allow you to specify different colors or CSS class per field in views definition.
Three new attributes will be available on the field element of a view:
- bgcolor: for setting the background color;
- fgcolor: for setting the foreground color (basically the text);
- ccsclass: for setting a custom CSS class to be applied on the field.
bg/fgcolor are very useful for people that only want to change some field color without having to deal with CSS, while cssclass comes in handy for assigning the same styles to a group of fields.
How to use it
- download it from launchpad or apps
- you must apply a simple patch to this server’s file `server/openerp/addons/base/rng/view.rng`. Just use the patch provided by this module (see server-view.rng.patch in the root of the package). This file declares the allowed attributes for any XML element (like <record /> <field /> etc.) so if you do not patch it you will get an error on form rendering;
- install it as any other module;
- customize a view. You can for instance modify a field declaration in any form view like this:
<field name="name" bgcolor="green" fgcolor="yellow" cssclass="myCssClass" />
And you are done! As usual any help / test / bug reporting is much appreciated. If you need to file a bug, please, do it on lp bug tracker.