Odoo Help


This community 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.


Change color in view depending on stage and date

Andrius Laukavičius
on 12/30/13, 8:13 AM 902 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?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


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