-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: price list with 0 value are ignored #26655
Merged
Merged
Conversation
This file contains 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
Steps to reproduce: 1. Create 2 item price for two different supplier. One of them should be zero. 2. Create PO 3. Add supplier with non-zero price and add item. 4. change supplier. Price won't change. If price was non-zero it would've changed. Root cause: falsiness check instead of null value check is used for checking if price list value exists. 0 is evaluated as false.
ankush
added
the
squash
Meant to tell reviewers that this PR should be squashed into a single commit while merging.
label
Jul 26, 2021
Passing a dictionary to update its like passing register to update a value, we are not in 80s ;)
The backport to
|
frappe-pr-bot
pushed a commit
to frappe-pr-bot/erpnext
that referenced
this pull request
Aug 9, 2021
* fix: price list with 0 value are ignored Steps to reproduce: 1. Create 2 item price for two different supplier. One of them should be zero. 2. Create PO 3. Add supplier with non-zero price and add item. 4. change supplier. Price won't change. If price was non-zero it would've changed. Root cause: falsiness check instead of null value check is used for checking if price list value exists. 0 is evaluated as false. * refactor: make get_price_list_rate function pure (cherry picked from commit 16d4de5)
ankush
added a commit
that referenced
this pull request
Aug 9, 2021
* fix: price list with 0 value are ignored Steps to reproduce: 1. Create 2 item price for two different supplier. One of them should be zero. 2. Create PO 3. Add supplier with non-zero price and add item. 4. change supplier. Price won't change. If price was non-zero it would've changed. Root cause: falsiness check instead of null value check is used for checking if price list value exists. 0 is evaluated as false. * refactor: make get_price_list_rate function pure (cherry picked from commit 16d4de5) Co-authored-by: Ankush <ankush@iwebnotes.com>
asoral
pushed a commit
to asoral/erpnext
that referenced
this pull request
Nov 12, 2021
* fix: price list with 0 value are ignored Steps to reproduce: 1. Create 2 item price for two different supplier. One of them should be zero. 2. Create PO 3. Add supplier with non-zero price and add item. 4. change supplier. Price won't change. If price was non-zero it would've changed. Root cause: falsiness check instead of null value check is used for checking if price list value exists. 0 is evaluated as false. * refactor: make get_price_list_rate function pure
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport version-13-hotfix
old-backport version-12-hotfix
squash
Meant to tell reviewers that this PR should be squashed into a single commit while merging.
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.
Steps to reproduce:
zero.
Root cause: falsy-ness check instead of null value check is used for checking if price list value exists. 0 is evaluated as false.
Fix: use null value check
is None
instead.Also refactored the function to make it pure. Passing around dictionaries to update is like programming in assembly and passing around registers. 馃槃