Name: [FIX] stock: avoid O(n²) move-line scan when reserving serial products

State: Killed finished in 99m

PR State: merged

PR Author: Roy Le

PR Author Email:

PR: #1232

Committer: Roy Le

Committer Email: roy.le@viindoo.com

Commit: 1245c6c00572b89d6dabce6da78753722062464b

Description:

                                            [FIX] stock: avoid O(n²) move-line scan when reserving serial products

_update_reserved_quantity searches for an updatable move line per
reserved quant via `next(l for l in self.move_line_ids if
l._reservation_is_updatable(..))`. This scans the (growing)
move_line_ids for every quant → O(n²) on a move of n serial units. But
stock.move.line._reservation_is_updatable returns False unconditionally
for tracking == 'serial', so the scan can never find a candidate and is
pure waste.
                                            

Branch: 16.0

Instance ID: 0

Age:

Up-time: