[FIX] stock_by_warehouse_sale: prevent singleton error in warehouse stock compute T#98915#1733
Open
rolandojduartem wants to merge 1 commit into
Conversation
…tock compute Fix a multi-record issue in _compute_warehouse_stock where 'self' was incorrectly referenced instead of the loop variable 'record' when assigning warehouse_id. This prevented correct evaluation and raised singleton errors on multi-line actions. Additionally, remove redundant empty/default keys from the manifest.
Contributor
Author
|
@luisg123v done |
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
When processing multiple sale order lines at once (e.g., during bulk creation, updates, or imports), a singleton error is raised, preventing the user from completing the action.
Root Cause
In
_compute_warehouse_stockof thesale.order.linemodel, thewarehouse_idassignment incorrectly referenced the active recordsetself(e.g.,self.order_id.warehouse_id) inside thefor record in self:loop instead of using the single loop variablerecord.Fix
record(i.e.,record.warehouse_id = record.order_id.warehouse_id).demo,test,installable,auto_install) from the module manifest.