[18.0][FIX] purchase_all_shipments: list only pickings of the reception chain - #3149
Open
les-adhoc wants to merge 1 commit into
Open
[18.0][FIX] purchase_all_shipments: list only pickings of the reception chain#3149les-adhoc wants to merge 1 commit into
les-adhoc wants to merge 1 commit into
Conversation
…on chain The all pickings field searched every picking sharing a procurement group with the order receipts. When that group is shared with other documents, as happens with dropshipping or with purchases generated from a sale order through a make to order route, the purchase order listed pickings belonging to those documents, including customer deliveries. Compute the field from the receipts of the order and the moves pushed by the reception route instead. This keeps the intermediate pickings of multi-step receptions and stops where the demand of another document pulls the goods.
les-adhoc
force-pushed
the
18.0-fix-purchase_all_shipments-all-pickings
branch
from
August 14, 2026 13:28
d800439 to
ea6de2b
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.
Problem
all_picking_idsis computed by searching every picking that shares a procurement group with the order receipts:The procurement group identifies the demand that originated the transfers, not the document that created them. It is therefore shared whenever a purchase exists because of a sale order, which is the case with:
Vendors -> Customersbuy rule propagates the group of the sale order;In those cases the group also holds the pickings of the originating document, so the All Pickings button of a purchase order lists customer deliveries and pickings of other purchase orders.
Two examples taken from a database where this happens:
The dropship case has been there for as long as the group is propagated by the buy rule. Since 93882d69, merged in 18.0 on 2026-07-30,
stock_dropshippingalso sets the group of the sale order on the receipts of any purchase order line linked to a sale order line, so regular warehouse receipts are now affected too. The field is a poor proxy for "the pickings of this purchase order", and upstream keeps making that more explicit.Solution
Compute the field from the receipts of the order and the moves pushed by the reception route, so only the pickings of the reception chain are listed.
Walking the chained moves is what keeps the intermediate pickings of multi-step receptions, which is the purpose of the module. Restricting the walk to moves created by a push rule is what stops it where another document pulls the goods: a move pushed by the reception route continues the reception, while a move pulled by the demand of a sale order belongs to that sale order.
Filtering by operation type instead would not work, because the intermediate picking of a multi-step reception and the pick of an outgoing delivery are both internal transfers.
Tests
Added a test asserting that a picking of another document sharing the procurement group is not listed. The existing multi-step reception tests are unchanged and still pass.