Skip to content

[19.0][FIX] ddmrp: exclude make-to-order demand from the net flow position - #634

Open
JordiBForgeFlow wants to merge 1 commit into
OCA:19.0from
ForgeFlow:19.0-exclude-mto-demand-from-nfp
Open

[19.0][FIX] ddmrp: exclude make-to-order demand from the net flow position#634
JordiBForgeFlow wants to merge 1 commit into
OCA:19.0from
ForgeFlow:19.0-exclude-mto-demand-from-nfp

Conversation

@JordiBForgeFlow

Copy link
Copy Markdown
Member

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.

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.
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @LoisRForgeFlow,
some modules you are maintaining are being modified, check this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants