CRND web tree colored field

by
Odoo
v 13.0 Third Party 429
Download for v 13.0 Deploy on Odoo.sh
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 60
Technical Name crnd_web_tree_colored_field
LicenseLGPL-3
Websitehttps://crnd.pro
Versions 12.0 15.0 13.0 14.0 16.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 60
Technical Name crnd_web_tree_colored_field
LicenseLGPL-3
Websitehttps://crnd.pro
Versions 12.0 15.0 13.0 14.0 16.0

CRnD Web Tree Colored Field

License: LGPL-3 CR&D GitHub


CRnD Web Tree Colored Field widget provide to display tree cell with color from another field or color, that depends on value of other field.


An example of internal usage defining color from another field:

In Python code:

        line_bg_color = fields.Char('rgba(R,G,B[,A])')
        line_label_color = fields.Char('rgba(R,G,B[,A])')
    

In XML code:

   <record id="some_id" model="ir.ui.view">
        <field name="model">model.name</field>
        <field name="arch" type="xml">
            <tree>
                <field name="colored_field"
                          options="{
                              'field_bg_color': 'line_bg_color',
                              'field_label_color': 'line_label_color'}"/>
                <field name="line_bg_color" invisible="1"/>
                <field name="line_label_color" invisible="1"/>
            </tree>
        </field>
    </record>
    


An example of internal usage defining color, depends on value of another field:

In Python code:

        state = fields.Selection([
        ('ok', 'Ok'),
        ('warning', 'Warning'),
        ('fail', 'Fail')
        ])
    

In XML code:

   <record id="some_id" model="ir.ui.view">
        <field name="model">model.name</field>
        <field name="arch" type="xml">
            <tree>
                <field name="colored_field"
                          options="{"field_label_color_expression": "
                       red:state == 'fail';
                       #2F4F4F:state == 'warning';
                       green:state == 'ok'",
                                "field_bg_color_expression": "
                       white:state == fail;
                       yellow:state == 'warning';
                       #D3D3D3:state == 'ok'"}"/>/>
                <field name="state" invisible="1"/>
            </tree>
        </field>
    </record>
    

Bug Tracker

Bugs are tracked on https://crnd.pro/requests. In case of trouble, please report there.


Launch your own ITSM system in 60 seconds:

Create your own Bureaucrat ITSM database yodoo.systems

Maintainer

CR&D

Our web site: https://crnd.pro

This module is maintained by the Center of Research & Development company.

We can provide you further Odoo Support, Odoo implementation, Odoo customization, Odoo 3rd Party development and integration software, consulting services. Our main goal is to provide the best quality product for you.

For any questions contact us.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.