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

Module: Inventory

Entity: stock.move

Compute Method: _compute_lot_ids

Inputs Method Outputs
domain = [('move_id', 'in', self.ids), ('lot_id', '!=', False), ('quantity', '!=', 0.0)]
lots_by_move_id = self.env['stock.move.line']._read_group(
            domain,
            ['move_id'], ['lot_id:array_agg'],
        )
lots_by_move_id = {move.id: lot_ids for move, lot_ids in lots_by_move_id}
for move in self:
            move.lot_ids = lots_by_move_id.get(move._origin.id, [])

Back to entity