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_picking_ids

Inputs Method Outputs
move_per_production_group = self.env['stock.move']._read_group(
            [('production_group_id', 'in', self.production_group_id.ids)],
            ['production_group_id'],
            ['picking_id:recordset'],
        )
move_per_production = {}
for group, pickings in move_per_production_group:
            move_per_production[group] = pickings
for order in self:
            order.picking_ids = move_per_production.get(order.production_group_id, False)
            order.delivery_count = len(order.picking_ids)

Back to entity