Hi, I want to change the color of the kanban view based on the expiration date   
Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
- CRM
- e-Commerce
- Kirjanpito
- Varastointi
- PoS
- Project
- MRP
Tämä kysymys on merkitty
            
                2
                
                    Vastaukset
                
            
        
        
            
                8891
                
                    Näkymät
                
            
        
    Hi
You can use the below XML code to set the color of a kanban view.
<kanban>
<!-- Other fileds-->
<field name="color"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="{{'oe_kanban_color_' + kanban_getcolor(record.color.raw_value) }} oe_kanban_card oe_kanban_global_click oe_semantic_html_override">
<!-- Define view-->
</div>
</t>
</templates>
</kanban>
And inside your model define a color field and compute its value according to the expiration date.
color = fields.Integer('Color', compute='_get_color')
def _get_color(self):
    """Compute Color value according to the conditions"""
    for rec in self:
        if rec.expiry_date:
            rec.color = 1
        else:
            rec.color = 2Hope it helps
try this
decoration-danger="condition"
Nautitko keskustelusta? Älä vain lue, vaan osallistu!
Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!
Rekisteröidy| Aiheeseen liittyviä artikkeleita | Vastaukset | Näkymät | Toimenpide | |
|---|---|---|---|---|
|  | 1 maalisk. 15  | 5588 | ||
|  | 2 toukok. 25  | 2167 | ||
|  | 1 elok. 21  | 4088 | ||
|  | 1 maalisk. 19  | 14001 | ||
|  | 2 lokak. 16  | 5830 | 
 
                        
a nice idea, did you find a solution?