Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: CRM

Entity: crm.lead

Compute Method: _compute_kanban_state

View 17.0
Inputs Method Outputs
  • activity_date_deadline
- today = date.today()
- for lead in self:
-             kanban_state = 'grey'
-             if lead.activity_date_deadline:
-                 lead_date = fields.Date.from_string(lead.activity_date_deadline)
-                 if lead_date >= today:
-                     kanban_state = 'green'
-                 else:
-                     kanban_state = 'red'
-             lead.kanban_state = kanban_state
  • kanban_state

Back to entity