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 lines with sequence number

Entity: stock.picking

Compute Method: _compute_max_line_sequence

Inputs Method Outputs
"""Allow to know the highest sequence entered in move lines.
        Then we add 1 to this value for the next sequence, this value is
        passed to the context of the o2m field in the view.
        So when we create new move line, the sequence is automatically
        incremented by 1. (max_sequence + 1)
        """
for picking in self:
            picking.max_line_sequence = (
                max(picking.mapped("move_ids.sequence") or [0]) + 1
            )

Back to entity