[19.0][FIX] ddmrp: exclude make-to-order demand from the net flow position - #634
Open
JordiBForgeFlow wants to merge 1 commit into
Open
[19.0][FIX] ddmrp: exclude make-to-order demand from the net flow position#634JordiBForgeFlow wants to merge 1 commit into
JordiBForgeFlow wants to merge 1 commit into
Conversation
Qualified demand counted every outgoing stock move for the product, including make-to-order (pegged) demand. MTO demand is served by its own dedicated supply, not from the buffer, so counting it deflated the net flow position and led to over-procurement of MTS buffers. This was also inconsistent with the supply side, which already keeps MTO purchase lines out of MTS buffers (purchase.order.line._find_buffer_link). Use one shared criterion on both sides, based on the same relation (stock.move.created_purchase_line_ids <-> purchase.order.line.move_dest_ids): - stock.move._ddmrp_is_mto(): the move raised a purchase to satisfy itself. - purchase.order.line._ddmrp_is_mto(): the line was raised for a demand move. _search_stock_moves_qualified_demand now drops MTO moves, and _find_buffer_link is refactored to use the mirrored helper. Because both ends test the same relation, a pegged demand move and the purchase line it created are always excluded together, keeping the net flow position consistent.
Contributor
|
Hi @LoisRForgeFlow, |
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.
Qualified demand counted every outgoing stock move for the product, including make-to-order (pegged) demand. MTO demand is served by its own dedicated supply, not from the buffer, so counting it deflated the net flow position and led to over-procurement of MTS buffers.
This was also inconsistent with the supply side, which already keeps MTO purchase lines out of MTS buffers (purchase.order.line._find_buffer_link).
Use one shared criterion on both sides, based on the same relation (stock.move.created_purchase_line_ids <-> purchase.order.line.move_dest_ids):
_search_stock_moves_qualified_demand now drops MTO moves, and _find_buffer_link is refactored to use the mirrored helper. Because both ends test the same relation, a pegged demand move and the purchase line it created are always excluded together, keeping the net flow position consistent.