[16.0][ADD] shopfloor_loss_quantity: declare a stock issue as a loss - #1266
Open
lmignon wants to merge 3 commits into
Open
[16.0][ADD] shopfloor_loss_quantity: declare a stock issue as a loss#1266lmignon wants to merge 3 commits into
lmignon wants to merge 3 commits into
Conversation
Contributor
|
Hi @mmequignon, @simahawk, @sebalix, @jbaudoux, @TDu, |
…ng strategy Reporting a stock issue on a move line goes through `create_stock_issue`, which silently corrects the quant's on-hand quantity so it can no longer be reserved elsewhere. In some context an other strategy could be adopted to makes these quantity no more available for exemple by declaring a traceable loss that locks the quant behind a move of the warehouse's Loss operation type instead. Add a `stock_issue_strategy` selection field on `shopfloor.menu`, exposed to the scenario's `shopfloor.inventory.action`. The field is only shown when the scenario declares the new `uses_stock_issue` option *and* more than one strategy is actually registered, so menus are not cluttered with a choice that has nothing to choose from. The way the stock issue is handled has been refactored into the scenario's methods for: * `zone_picking.stock_issue` * `cluster_picking.stock_issue` * `location_content_transfer.stock_out_package` * `location_content_transfer.stock_out_line` Before this change, each method handled the whole logic for reporting a stock issue on its own, without a common strategy mechanism in place to neutralize the impacted move lines (unlink/cancel/unreserve). This neutralization logic was even a prerequisite to the correct handling of the `inventory.create_stock_issue` method. This made it impossible to easily adopt a different strategy for handling stock issues. A new common method `handle_stock_issue` has been introduced all the logic for handling stock issues in a centralized manner, allowing different strategies to be implemented. Enable `uses_stock_issue` on the cluster picking, zone picking and location content transfer scenarios, with a migration backfilling the option on existing scenario records.
Add a "Loss Declaration" `stock_issue_strategy` for the shopfloor stock issue mechanism. Instead of immediately correcting the inventory this strategy locks the quant through `stock_picking_operation_loss_quantity`.
lmignon
force-pushed
the
16.0-shopfloor-loss-quantity
branch
from
September 8, 2026 15:01
e60e1a5 to
456968c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a "Loss Declaration"
stock_issue_strategyfor the shopfloor stockissue mechanism.
Instead of immediately correcting the inventory this strategy locks the
quant through
stock_picking_operation_loss_quantity.Depends on: