-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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: Incorrect packing list for recurring items & code cleanup #29456
Merged
marination
merged 8 commits into
frappe:develop
from
marination:product-bundle-packing-list-logic
Feb 3, 2022
Merged
fix: Incorrect packing list for recurring items & code cleanup #29456
marination
merged 8 commits into
frappe:develop
from
marination:product-bundle-packing-list-logic
Feb 3, 2022
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
- Fix Incorrect packing list for recurring items in the Items table - Re-organised functions based on external use and order of use - Deleted `clean_packing_list` function and reduced no.of loops - Raw SQL to QB - Minor formatting changes
- `doc_before_save` does not exist via Update Items (updates stuff in the backend so doc isn't considered unsaved/dirty) - converted more raw sql to qb and ORM
174ac88
to
a925165
Compare
- Create an indexed map of stale packed items table to avoid loops to check if packed item row exists - Reset packed items if row deletion takes place - Renamed functions to self-explain them - Split long function - Reduce function calls inside function (makes it harder to follow through)
a925165
to
4c677ea
Compare
- Smaller functions for updation - All calls visible from parent function to avoid context switching due to nested calls
Codecov Report
@@ Coverage Diff @@
## develop #29456 +/- ##
============================================
+ Coverage 40.58% 58.80% +18.21%
============================================
Files 1107 1108 +1
Lines 69136 69292 +156
============================================
+ Hits 28058 40745 +12687
+ Misses 41078 28547 -12531
|
- fetch price from price list, use item master valuation rate as fallback fo0r packed item - use a item code, item row name map to maintain cumulative price - reset table if item in a row is replaced - loop over items table only to set price, lesser iterations than packed items table
@Mergifyio backport version-13-hotfix |
✅ Backports have been created
|
marination
added a commit
that referenced
this pull request
Feb 4, 2022
…-29456 fix: Incorrect packing list for recurring items & code cleanup (backport #29456)
marination
added a commit
that referenced
this pull request
Feb 4, 2022
…se/pr-29456 fix: Incorrect packing list for recurring items & code cleanup (backport #29456)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Introduced via #27124
Issues:
1) Recurring Items in Sales transactions
2) Code comprehensibility
Fix:
make_packing_list
in packed_item.py should give a clear overview of the sequence of eventsvaluation_rate
if no price is set as per price listToDo:
To test:
valuation_rate