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 Qty and Rates in SO/PO #38252

Merged
merged 5 commits into from
Nov 27, 2023

Conversation

marination
Copy link
Collaborator

@marination marination commented Nov 21, 2023

Issue:

  • This is allowed in Sales and Purchase Orders
    Screenshot 2023-11-21 at 1 29 19 PM

  • The same isn't allowed via Update Items
    Screenshot 2023-11-21 at 1 30 05 PM

  • Similarly negative rates aren't allowed via Update Items either

Fix:

  • Make sure on SO/PO save the qty is validated (negative qty not allowed)
    Screenshot 2023-11-21 at 1 27 13 PM
  • Also, allow negative rates on Update Items and normal doc submission/save

Copy link

codecov bot commented Nov 22, 2023

Codecov Report

Merging #38252 (b59a74f) into develop (56e991b) will increase coverage by 0.01%.
Report is 51 commits behind head on develop.
The diff coverage is 95.83%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #38252      +/-   ##
===========================================
+ Coverage    67.26%   67.27%   +0.01%     
===========================================
  Files          757      757              
  Lines        60505    60580      +75     
===========================================
+ Hits         40700    40757      +57     
- Misses       19805    19823      +18     
Files Coverage Δ
erpnext/assets/doctype/asset/asset.py 80.44% <100.00%> (ø)
erpnext/controllers/accounts_controller.py 84.95% <100.00%> (+0.11%) ⬆️
erpnext/controllers/buying_controller.py 83.94% <ø> (ø)
...serial_and_batch_bundle/serial_and_batch_bundle.py 73.15% <100.00%> (ø)
erpnext/projects/doctype/timesheet/timesheet.py 78.34% <66.66%> (-0.23%) ⬇️

... and 19 files with indirect coverage changes

@marination marination changed the title fix: Don't allow negative qty in SO/PO fix: Negative Qty and Rates in SO/PO Nov 22, 2023
@rohitwaghchaure rohitwaghchaure merged commit b9f5a1c into frappe:develop Nov 27, 2023
13 checks passed
mergify bot pushed a commit that referenced this pull request Nov 27, 2023
* fix: Don't allow negative qty in SO/PO

* fix: Type casting for safe comparisons

* fix: Grammar in error message

* fix: Negative rates should be allowed via Update Items in SO/PO

* fix: Use `non_negative` property in docfield & emove code validation

(cherry picked from commit b9f5a1c)
rohitwaghchaure pushed a commit that referenced this pull request Nov 27, 2023
fix: Negative Qty and Rates in SO/PO (#38252)

* fix: Don't allow negative qty in SO/PO

* fix: Type casting for safe comparisons

* fix: Grammar in error message

* fix: Negative rates should be allowed via Update Items in SO/PO

* fix: Use `non_negative` property in docfield & emove code validation

(cherry picked from commit b9f5a1c)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
frappe-pr-bot pushed a commit that referenced this pull request Nov 28, 2023
# [15.4.0](v15.3.0...v15.4.0) (2023-11-28)

### Bug Fixes

* allow on submit for child table fields ([ac7615a](ac7615a))
* annual income and expenses in digest ([ca2ad17](ca2ad17))
* check reposting settings before allowing editable si ([25bf475](25bf475))
* condition in other bundle utils ([e4d9ef1](e4d9ef1))
* create contact if existing customer doesn't have contact ([b1b065d](b1b065d))
* display all item rate stop messages (backport [#38289](#38289)) ([#38307](#38307)) ([99c1fbf](99c1fbf))
* do not set repost flag without validating voucher ([6a3c3b4](6a3c3b4))
* don't depreciate assets with no schedule on scrapping (backport [#38276](#38276)) ([#38293](#38293)) ([18613c5](18613c5))
* filter bundle items based on disabled check ([fb517e8](fb517e8))
* fiscal year using future date ([b9a1fac](b9a1fac))
* has_product_bundle util to only check for enabled bundles ([5c12872](5c12872))
* job card overlap validation (backport [#38345](#38345)) ([#38348](#38348)) ([d6fe7eb](d6fe7eb))
* make parameters of `create_subscription_process` optional (and other minor fixes) ([#38360](#38360)) ([721b429](721b429))
* Negative Qty and Rates in SO/PO (backport [#38252](#38252)) ([#38357](#38357)) ([14174df](14174df))
* no fstring in translation (backport [#38381](#38381)) ([#38387](#38387)) ([c101855](c101855))
* patch - Duplicate entry quality inspection parameter (backport [#38262](#38262)) ([#38264](#38264)) ([4c9890a](4c9890a))
* Payment Reco Issue and chart of account importer ([4699887](4699887))
* serial no status (backport [#38391](#38391)) ([#38397](#38397)) ([b65c225](b65c225))
* Server Error while creating Product Bundle (backport [#38377](#38377)) ([#38380](#38380)) ([922aef6](922aef6))
* skip disabled bundles for non-report utils ([3d46b32](3d46b32))
* skip fixed assets in parent ([314a91a](314a91a))
* Supplier `Primary Contact` (backport [#38268](#38268)) ([#38286](#38286)) ([37d1f1a](37d1f1a))
* **ux:** Sales Order Stock Reservation Dialog (backport [#38261](#38261)) ([#38344](#38344)) ([3cbe599](3cbe599))
* validation for existing bundles ([c0de9c0](c0de9c0))

### Features

* add Bank Transaction to connections in Journal and Payment Entry (backport [#38297](#38297)) ([#38301](#38301)) ([72647b8](72647b8))
* add disabled field in product bundle ([fcd53be](fcd53be))
* new Report "Lost Quotations" ([#38309](#38309)) ([ea2c348](ea2c348))

### Performance Improvements

* optimize total_purchase_cost update ([deed9f5](deed9f5))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 5, 2024
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.

4 participants