Skip to content

Conversation

@agyamuta
Copy link

@agyamuta agyamuta commented Jun 4, 2025

When there is a discrepancy of reserved quantity between stock.quant.reserved_quantity and stock.move.line.product_qty the UserError 'It is not possible to unreserve more products of %s than you have in stock' is raised.
This discrepancy can be caused by past bug, customization or direct manipulation of stock.quant or stock.move.line by the users. Once this discrepancy is present, it will not disappear by itself.

Currently, there is no functional method to fix these discrepancies, the user encountering this message is stuck until they contact the Odoo support team.

Ideally, we would fix every bug related to the reservation so that this UserError almost never appears. However, even after multiple bugs fixed (ex: odoo#144176 , odoo#154327 ) and multiple years of feedback, the users keep encountering this error and keep getting stuck when validating/cancelling transfers.

So the idea is to re-introduce a server action like it was done for Odoo 13 & Odoo 14 2 years ago: d99e173 to the current stable version (except the latest one Odoo 17 as we do not have enough perspectives on this version).

The server action checks all the quants and their relative move line to check if match correctly. If not, it will remove the reservation from both. It could remove the reservation from some unrelated pickings and stock.move

Forward-Port of odoo#79180
Related to odoo#62139

closes odoo#155910

X-original-commit: e16cd27

(cherry picked from commit e0e63be)

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

When there is a discrepancy of reserved quantity between `stock.quant.reserved_quantity` and `stock.move.line.product_qty` the UserError 'It is not possible to unreserve more products of %s than you
have in stock' is raised.
This discrepancy can be caused by past bug, customization or direct manipulation of `stock.quant` or `stock.move.line` by the users.
Once this discrepancy is present, it will not disappear by itself.

Currently, there is no functional method to fix these discrepancies, the user encountering this message is stuck until they contact the Odoo support team.

Ideally, we would fix every bug related to the reservation so that this UserError almost never appears.
However, even after multiple bugs fixed (ex: odoo#144176 , odoo#154327 ) and multiple years of feedback, the users keep encountering this error and keep getting stuck when validating/cancelling transfers.

So the idea is to re-introduce a server action like it was done for Odoo 13 & Odoo 14 2 years ago: d99e173 to the current stable version (except the latest one Odoo 17 as we do not have enough perspectives on this version).

The server action checks all the quants and their relative move line to check if match correctly. If not, it will remove the reservation from both.
It could remove the reservation from some unrelated `pickings` and `stock.move`

Forward-Port of odoo#79180
Related to odoo#62139

closes odoo#155910

X-original-commit: e16cd27
Signed-off-by: David Fesquet (dafr) <dafr@odoo.com>
Co-authored-by: Arnold Moyaux <arm@odoo.com>
(cherry picked from commit e0e63be)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants