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

Module: Manufacturing

Entity: mrp.workorder

Compute Method: _compute_decoration_dates

Inputs Method Outputs
self.decoration_dates = ''
now = fields.Datetime.now()
today = fields.Date.context_today(self)
for wo in self:
            if wo.state in ['done', 'cancel']:
                continue
            if wo.state == 'progress':
                if wo.date_finished and wo.date_finished < now:
                    wo.decoration_dates = 'danger'
            elif wo.date_start:
                if wo.date_start.date() < today:
                    wo.decoration_dates = 'danger'
                elif wo.date_start.date() == today:
                    wo.decoration_dates = 'warning'

Back to entity