fix: order and time of operations in multilevel BOM work order - #25886
Merged
Conversation
ankush
force-pushed
the
work_order_flat_ops
branch
4 times, most recently
from
May 31, 2021 17:13
9e3e119 to
9565302
Compare
ankush
marked this pull request as ready for review
May 31, 2021 17:14
ankush
marked this pull request as draft
June 10, 2021 06:53
ankush
force-pushed
the
work_order_flat_ops
branch
5 times, most recently
from
June 11, 2021 07:38
cd75eac to
ad2464c
Compare
ankush
force-pushed
the
work_order_flat_ops
branch
2 times, most recently
from
June 11, 2021 09:16
f4e2371 to
68c22b0
Compare
ankush
marked this pull request as ready for review
June 11, 2021 09:17
ankush
force-pushed
the
work_order_flat_ops
branch
2 times, most recently
from
June 12, 2021 13:19
1998fa0 to
0cb5723
Compare
Contributor
ankush
force-pushed
the
work_order_flat_ops
branch
from
June 14, 2021 11:54
0cb5723 to
4a2881e
Compare
Member
Author
|
@marination rebased branch 👍 |
form_grid_template doesn't exist
- Order of operations was being sorted by idx of individual operations in BOM table, which made the ordering useless. - This adds ordering that's sorted from lowest level item to top level item. - chore: remove dead functionality. There's no `items` table. Required item level operations get overwritten on fetching of items / operations e.g. when clicking on multi-level BOM checkbox. - test: add test for tree representation - feat: BOMTree class to get complete representation of a tree
ankush
force-pushed
the
work_order_flat_ops
branch
from
June 25, 2021 09:15
4a2881e to
9e43445
Compare
marination
approved these changes
Jun 25, 2021
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.
Problem: When multilevel BOM is ticked, work order tries to fetch all operations in single query and sorts by
idxwhich gives meaningless ordering.Solution: order by level (reversed) i.e. in a tree representation bottom-most BOM operations are listed first.
Before (meaningless ordering, wrong index, operations time not considering exploded qty):

After (Order of operations = reverse level order traversal, operations time considering exploded qty):

Also added

__repr__for BOMTree that shows complete BOM like this:TODO:
WARNING: Ideally, this ordering should not be relied upon and a separate work order should be made for each subassembly. You lose the benefit of parallel traceability and there could be duplication if there's a BOM that's part of two different nodes in the BOM tree. This change is for sake of correctness.