Skip to content

[12.0][stock] Not possible to unreserve more products than you have in stock #62139

@JordiBForgeFlow

Description

@JordiBForgeFlow

Impacted versions: 12.0

Steps to reproduce:
It's not possible to reproduce in normal circumstances. We have faced this error in situations of multiple concurrent users trying to pick.

Picking 1 is created, reserving stock in location A.
Picking 2 is created, reserving stock in location A.
Inventory adjustment is created, updating quantity in location A

User 1 and 2 complete the picking concurrently, and the inventory adjustment may be done during the process.

Current behavior:

A mismatch between the reserved quantity in quants and in move lines results in the following error: https://github.com/odoo/odoo/blob/12.0/addons/stock/models/stock_quant.py#L269 when the user attempts to complete the picking.

We also find cases where there are move lines with reserved quantity, but there's no quant.

Expected behavior: The integrity between quants and move lines should be always respected.

Have you faced this inconsistency between quants and move lines before @amoyaux @rco-odoo? It's hitting us pretty bad.

We had to end up designing a con job that runs every 10 minutes to locate the inconsistent quant/move lines and align them. Not good.

Metadata

Metadata

Assignees

No one assigned

    Labels

    12.0Logisticsabout stock, mrp, delivery, purchaseOEthe report is linked to a support ticket (opw-...)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions