Repository navigation
Fork Sync Branch 18.0 - #14
Merged
Merged
Conversation
…ndor receipt nor a counter-delivery When cancelling the remaining qty, lowering product_qty does not always cancel the pending receipt: with a refund return (ticket 124773) a live pending IN remains and inflates the forecast of units to receive, and when the negative move does not net against the pending one (different price/final location) a counter-delivery to the vendor is generated (ticket 124957). We now explicitly cancel the line's open remaining move. In 1, 2 or 3 step receptions the pending qty to receive always lives in the first-step move (vendor->input), which hangs off move_ids and has no downstream; core (_action_cancel) propagates to later moves if needed, so there is no need to walk the chain. The cancel is scoped to genuine forward vendor receipts: exchange-return replacements (a legitimate expected receipt) and open, not-yet-validated vendor returns (origin_returned_move_id, which also hang off move_ids and are not part of the remainder) are excluded. product_qty is not touched, so invoicing (qty_to_invoice) stays intact. Also replace the expensive fields_get() probe in _is_exchange_move_helper with a plain 'is_exchange_move' in self._fields check (O(1), no full field-descriptor build). Tests (test_cancel_remaining.py, over 1/2/3 steps): partial receipt, refund return (124773), preservation of goods in transit, and an open vendor return that must survive cancel remaining (RED without the origin_returned_move_id guard). closes #358 Signed-off-by: Luciano Esperlazza <les@adhoc.inc>
sireko
approved these changes
Aug 27, 2026
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.
No description provided.