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

Module: Stock Picking Volume

Entity: stock.picking

Compute Method: _compute_volume

Inputs Method Outputs
for picking in self:
            moves = picking.move_ids
            # Only include cancelled moves in the result if all moves are cancelled
            exclude_cancel = any(m.state != "cancel" for m in moves)
            if exclude_cancel:
                moves = moves.filtered(lambda move: move.state != "cancel")
            volume = sum(moves.mapped("volume"))
            if picking.volume != volume:
                picking.volume = volume

Back to entity