Repository navigation
[pull] master from inventree:master - #147
Merged
Merged
Conversation
* Hide "top level stock location" panel Co-authored-by: Copilot <copilot@github.com> * Hide "top level part category" Co-authored-by: Copilot <copilot@github.com> * Adjust playwright tests * Improve robustness of test Co-authored-by: Copilot <copilot@github.com> --------- Co-authored-by: Copilot <copilot@github.com>
- Prevent duplicate parameters - Closes #11798 Co-authored-by: Copilot <copilot@github.com>
- Closes #10946 Co-authored-by: Copilot <copilot@github.com>
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )
Greptile Summary
This PR syncs upstream InvenTree changes across three areas: a backend fix deduplicating category parameter templates during part creation, a frontend
OrderPartsWizardenhancement tracking raw vs. pack-adjusted quantities, and a UI cleanup that hides the Details tab (and its top-level placeholder text) when browsing the root category or stock location.OrderPartsWizard:quantity_rawis only initialised once inselectQuantity(guarded by=== undefined), so if a user manually edits the quantity after a supplier part has been selected, the change is not reflected inquantity_raw. A subsequent supplier-part switch re-derivesquantityfrom the stalequantity_raw, silently discarding the user's edit.!quantity_raw) rather than a nullish check, which would incorrectly overwrite a legitimatequantity_raw = 0.Confidence Score: 4/5
Safe to merge with minor quantity-tracking edge cases in the OrderPartsWizard.
No P0/P1 issues found. Two P2 findings in OrderPartsWizard around quantity_raw update logic; all other changes are clean refactors with matching test updates.
src/frontend/src/components/wizards/OrderPartsWizard.tsx — quantity_raw update logic needs review.
Important Files Changed
Sequence Diagram
sequenceDiagram participant U as User participant W as OrderPartsWizard participant R as PartOrderRecord U->>W: Open wizard (parts initialised) W->>R: quantity=to_order, quantity_raw=undefined U->>W: selectQuantity(partId, qty) W->>R: quantity = qty Note over R: quantity_raw set only if undefined U->>W: selectSupplierPart(partId, supplierPart) W->>R: If quantity_raw falsy: quantity_raw = quantity W->>R: If pack_quantity_native present: quantity = quantity_raw / pack_quantity_native U->>W: selectQuantity(partId, newQty) [manual edit] W->>R: quantity = newQty Note over R: quantity_raw NOT updated (already set) U->>W: selectSupplierPart(partId, newSupplierPart) W->>R: quantity = quantity_raw / new_pack_quantity_native Note over R: Manual quantity edit lost — recalculates from stale quantity_rawComments Outside Diff (2)
src/frontend/src/components/wizards/OrderPartsWizard.tsx, line 515-517 (link)quantity_rawnot updated on manual quantity changeAfter a supplier part is selected,
quantityis divided bypack_quantity_nativeandquantity_rawis frozen. If the user then manually editsquantityin the UI,selectQuantityis called — but sincequantity_raw !== undefined, the guard on line 495 prevents it from updating. When the user subsequently switches supplier parts,quantityis recalculated from the stalequantity_rawinstead of the manually-entered value, silently discarding the user's edit.Consider also updating
quantity_rawinsideselectQuantitywhen a supplier part is already selected, or resetting it proportionally based on the new pack count.src/frontend/src/components/wizards/OrderPartsWizard.tsx, line 515 (link)Falsy check misses
quantity_raw = 0The condition
!records[index].quantity_rawtreats0as falsy, so ifquantity_rawwas explicitly set to0(valid for a part with no required stock), this branch will overwrite it with the currentquantity. Using== nullwould be safer.Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "Adjust order quantity based on pack size..." | Re-trigger Greptile