fix: allow creating stock entry based on work order for customer provided items #24885
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.
Earlier PR: #24753
Allows creation of Stock Entry based on Work Order if items are customer provided (valuation rate is zero).
This used to work previously, but since #24031 it throws below traceback:
Changes Made
validate_customer_provided_item
method inget_items
.raise_error_if_no_rate
param from call toget_customer_provided_items
inget_items
.raise_error_if_no_rate
works, since it is still being used in Stock Ledger.Steps to Replicate
It is true that this error does not get thrown if at least one Stock Ledger entry exists (for this customer provided item at the source warehouse) when trying to create a Stock Entry. But this may not always be the case. Take following scenarios: