refactor!: dynamically compute bom_level - #29522
Merged
Merged
Conversation
ankush
requested review from
deepeshgarg007,
marination,
nextchamp-saqib and
rohitwaghchaure
as code owners
January 30, 2022 16:41
ankush
marked this pull request as draft
January 30, 2022 16:41
Codecov Report
@@ Coverage Diff @@
## develop #29522 +/- ##
===========================================
- Coverage 58.47% 58.12% -0.36%
===========================================
Files 1091 1091
Lines 68013 68003 -10
===========================================
- Hits 39770 39526 -244
- Misses 28243 28477 +234
|
ankush
marked this pull request as ready for review
January 30, 2022 17:31
rohitwaghchaure
approved these changes
Jan 31, 2022
Collaborator
|
@Mergifyio backport version-13-hotfix |
Contributor
✅ Backports have been createdDetails
|
ankush
added a commit
that referenced
this pull request
Jan 31, 2022
* refactor!: dynamically compute bom_level (cherry picked from commit 157b4b3) # Conflicts: # erpnext/manufacturing/doctype/bom/bom.py # erpnext/patches.txt * fix(ux): sort multi-production item plans correctly (cherry picked from commit d38fd86) * fix: conflicts * fix: removed set_bom_level * fix: conflict Co-authored-by: Ankush Menat <ankush@frappe.io> Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
Contributor
|
@ankush how will the his change affect the BOM update tool ? |
Member
Author
It doesn't affect the BOM update tool. We were using this field only for sorting production plan subassemblies and nothing else. |
This file contains hidden or 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
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.
#26240 introduced a field called "BOM level" to properly sort subassemblies in the production plan. This however relied on value present in BOM.
Since a BOM's level is not a static value but depends on context, this has to be computed dynamically. Thankfully
indentis exactly that, starting with the 0th level and recursively adding the level as it goes. (another alternative was to useBOMTreeclass which generates this on the fly too)Breaking Change:
erpnext/erpnext/manufacturing/doctype/production_plan/production_plan.py
Line 563 in 157b4b3
Secondary fix:
Example:
Suppose we are manufacturing 2 items with nested tree like this:
Then generated list of subassembly should be like this:
Basically, items that are at the lowest level in BOM tree should appear first. Similar to Work Order fix: #25886