Skip to content

[16.0][ADD] shopfloor_loss_quantity: declare a stock issue as a loss - #1266

Open
lmignon wants to merge 3 commits into
OCA:16.0from
acsone:16.0-shopfloor-loss-quantity
Open

[16.0][ADD] shopfloor_loss_quantity: declare a stock issue as a loss#1266
lmignon wants to merge 3 commits into
OCA:16.0from
acsone:16.0-shopfloor-loss-quantity

Conversation

@lmignon

@lmignon lmignon commented Sep 8, 2026

Copy link
Copy Markdown

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.

Depends on:

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @mmequignon, @simahawk, @sebalix, @jbaudoux, @TDu,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added series:16.0 mod:shopfloor Module shopfloor mod:shopfloor_loss_quantity Module shopfloor_loss_quantity labels Sep 8, 2026
…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
lmignon force-pushed the 16.0-shopfloor-loss-quantity branch from e60e1a5 to 456968c Compare September 8, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:shopfloor_loss_quantity Module shopfloor_loss_quantity mod:shopfloor Module shopfloor series:16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants