Odoo Help


Change color in view depending on stage and date

Andrius Laukavičius
on 12/30/13, 8:13 AM 1,378 views

How can I customize view (via inheritance), so it would change color of opportunity depending on stage and specific date field. I will have a module that adds integer field in opportunity stages form. This field means, how many dates system should wait from start of that stage. For example if opportunity stage new was set at 2013-12-18 and for that stage wait time was chosen 2 days, then at 2013-12-20, that opportunity should change color to red. And the same would be for another stage, depending on days configured for that stage.

Something similar was done here in crm module:

<div style="padding-left: 0.5em">
      <t t-if="record.date_deadline.raw_value and record.date_deadline.raw_value lt (new Date())" t-set="red">oe_kanban_text_red</t>
      <span t-attf-class="#{red || ''}"><field name="date_action"/></span>
       <t t-if="record.date_action.raw_value"> : </t>
        <field name="title_action"/>

But it is only for one stage. How can I make it dynamical, so it would check any number of stages (depending on sales team) and set color to red if wait time has passed for current stage?

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 12/30/13, 8:13 AM
Seen: 1378 times
Last updated: 3/16/15, 8:10 AM