Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: negative batch issue #38688

Conversation

rohitwaghchaure
Copy link
Collaborator

While cancelling the stock transactions with Batch, system don't validate negative stock

  • Create a Batch Item.
  • Create a Stock Entry (Material Receipt) [Qty = 100, Batch = B1].
  • Create a Delivery Note for 10 Qty.
  • Create another Stock Entry (Material Receipt) [Qty = 200, Batch = B2].
  • Now, cancel the first Stock Entry.

Current Behaviour: The Stock Entry gets cancelled, Batch (B1) Qty get set to 0. RIV gets stuck in In Progress (the validation thrown while updating the Delivery Note bundle)

After Fix

User will get the validation error

Screenshot 2023-12-12 at 3 05 27 PM

Fixed #37728

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Merging #38688 (c8e2379) into develop (be312ce) will decrease coverage by 0.08%.
Report is 27 commits behind head on develop.
The diff coverage is 50.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #38688      +/-   ##
===========================================
- Coverage    60.15%   60.07%   -0.08%     
===========================================
  Files          759      759              
  Lines        69487    69540      +53     
===========================================
- Hits         41798    41775      -23     
- Misses       27689    27765      +76     
Files Coverage Δ
erpnext/controllers/accounts_controller.py 85.10% <100.00%> (+0.04%) ⬆️
...serial_and_batch_bundle/serial_and_batch_bundle.py 70.68% <35.29%> (-0.46%) ⬇️

... and 9 files with indirect coverage changes

@rohitwaghchaure rohitwaghchaure merged commit 69d7a64 into frappe:develop Dec 12, 2023
13 checks passed
mergify bot pushed a commit that referenced this pull request Dec 12, 2023
(cherry picked from commit 69d7a64)
rohitwaghchaure added a commit that referenced this pull request Dec 12, 2023
fix: negative batch issue (#38688)

(cherry picked from commit 69d7a64)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
frappe-pr-bot pushed a commit that referenced this pull request Dec 12, 2023
# [15.6.0](v15.5.0...v15.6.0) (2023-12-12)

### Bug Fixes

* `split_invoices_based_on_payment_terms` (backport [#37859](#37859)) ([#38488](#38488)) ([4b76cc4](4b76cc4))
* 1st row depr. sch. value of asset put to less than 180 days acc. to I.T. S. 32 (backport [#38696](#38696)) ([#38703](#38703)) ([2bd9671](2bd9671))
* auto delete draft serial and batch bundle (backport [#38637](#38637)) ([#38654](#38654)) ([b0675f6](b0675f6))
* close PO on SCO close (backport [#38667](#38667)) ([#38681](#38681)) ([4055543](4055543))
* format only if searched text contain link value text ([d79e6e3](d79e6e3))
* get customers for leaderboard ([9d5c79d](9d5c79d))
* get items for leaderboard ([7cb38a8](7cb38a8))
* get sales partner for leaderboard ([3845d42](3845d42))
* get sales person for leaderboard ([2fcfebe](2fcfebe))
* get suppliers for leaderboard ([e205772](e205772))
* ignore non-existing regional customizations (backport [#38621](#38621)) ([#38624](#38624)) ([c70e6f2](c70e6f2))
* limit end date to current date ([dbdb971](dbdb971))
* negative batch issue (backport [#38688](#38688)) ([#38694](#38694)) ([a75081b](a75081b))
* not able to make serial and batch using csv import (backport [#38659](#38659)) ([#38662](#38662)) ([dd07eca](dd07eca))
* only highest eligible coupon applied ([#38416](#38416)) ([aa66ee6](aa66ee6))
* serial and batch bundle permission (backport [#38618](#38618)) ([#38619](#38619)) ([ce2bd15](ce2bd15))
* serial no filter in the Serial No Ledger report (backport [#38669](#38669)) ([#38682](#38682)) ([d188c8e](d188c8e))
* Shipping Address Link Showing in Buying (backport [#38634](#38634)) ([#38646](#38646)) ([4150ed9](4150ed9))
* show stock qty in popup (backport [#38698](#38698)) ([#38699](#38699)) ([6e2cde4](6e2cde4))
* typeerror on new sites ([#38692](#38692)) ([9239e73](9239e73))
* typo in unittest ([#38673](#38673)) ([14ee13c](14ee13c))
* **ux:** don't update qty blindly (backport [#38608](#38608)) ([#38639](#38639)) ([0b2e2a2](0b2e2a2))

### Features

* add employee number to client user bootinfo (backport [#38477](#38477)) ([#38603](#38603)) ([c7dbcbc](c7dbcbc))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate batch qty on cancel
1 participant