fix: remove posting date & time on SRE batch validation (backport #51553) #51578
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.
Issue: Unable to create backdated outward entry for batch item with available qty.
Ref: 52652
Solution: Since, we are not maintaining posting date and time in stock reservation entry, validation for unreserved batch quantity should also follow the same. Removed posting date & time filter while getting available batch quantities.
Steps to replicate:
(Enable Stock Reservation in Stock Settings)
Create a new Batch Item
Create a new Stock Entry of Type Material Receipt and Select Date as 01-12-25 and enter qty as 300.
Create a another new Stock Entry of Type Material Receipt and Select Date as 23-12-25 and enter qty as 300 and select the same batch that created in Previous Stock Entry.
Create a Sales Order for 450 qty. Create a Pick List and select the batch created by stock entry. And Reserve the Stock
Now Overall batch balance is 600, Reserved qty on that batch is 450 and available to consume is 150 qty.
On submitting this material transfer, system throws error for Stock Reservation. But even after this entry there is enough stock for stock reservation and the stock balance will not go negative.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.
This is an automatic backport of pull request #51553 done by [Mergify](https://mergify.com).