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.production

Compute Method: _compute_date_finished

View 17.0 View 20.0
Inputs Method Outputs
  • date_start
  • is_planned
  • state
  • bom_id
  • bom_id.produce_delay
  • workorder_ids
for production in self:
            if not production.date_start or production.is_planned or production.state == 'done':
                continue
            days_delay = production.bom_id.produce_delay
            date_finished = production.date_start + relativedelta(days=days_delay)
            if production._should_postpone_date_finished(date_finished):
-                 workorder_expected_duration = sum(production.workorder_ids.mapped('duration_expected'))
-                 date_finished = date_finished + relativedelta(minutes=workorder_expected_duration or 60)
+                 date_finished = production._calculate_expected_finished_date(date_finished) or \
+                     (date_finished + relativedelta(minutes=sum(production.workorder_ids.mapped('duration_expected')) or 60))
            production.date_finished = date_finished
  • date_finished

Back to entity