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_active_workcenter_ids

View 20.0
Inputs Method Outputs
  • workorder_ids
  • workorder_ids.ids
+ active_workcenters_by_mo = self.env["mrp.workcenter.productivity"]._read_group(
+             [("workorder_id", "in", self.workorder_ids.ids), ("date_end", "=", False)],
+             ["production_id"], ["workcenter_id:recordset"],
+         )
+ self.active_workcenter_ids = False
+ for production, workcenters in active_workcenters_by_mo:
+             production.active_workcenter_ids = workcenters
  • active_workcenter_ids

Back to entity