This question has been flagged
5099 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"/>
  </div>

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?

Avatar
Discard