[master]-Cannot delete Project Planning Line due to incorrect reservation entries#9346
Conversation
…jectPlanningLine_ReservationError
…jectPlanningLine_ReservationError
…jectPlanningLine_ReservationError
…jectPlanningLine_ReservationError
…jectPlanningLine_ReservationError
Copilot PR ReviewIteration 6 · Outcome: completed Knowledge source: https://github.com/microsoft/BCQuality@186d8a131465475c79244d994acb872cd5c0d4bf Orchestrator pre-filter (2 file(s) excluded)
Findings produced by the AL review agent v1.7.3. Reply 👎 on any inline comment to flag false positives. |
Agentic PR Review - Round 1Recommendation: Reject ChangesWhat this PR doesThis PR changes The code itself matches the current head of PR 9034 exactly ( SuggestionsS1 - Close the duplicate PR channel S2 - Align the work item reference if kept Risk assessment and necessityRisk: The changed code is in a sensitive planning and reservation flow. A wrong base quantity can leave orphan reservation entries and block project planning line deletion. The implemented guard is narrow, has no public API change, and the deterministic test covers the Qty. per UoM rounding case and the deletion cleanup path. Necessity: Bug 640455 is valid and important, and the fix is needed. But this PR is not the right merge channel while PR 9034 is open with the same head commit and review history. This meets the Reject Changes criterion that the PR should not be merged through this duplicate channel and should be consolidated.
|
|
S1 - Close the duplicate PR channel - Closed original PR |
There was a problem hiding this comment.
Pull request overview
This PR addresses a planning/reservation rounding edge case that can produce inconsistent reservation entries when carrying out action messages, which then prevents deleting related Job Planning Lines (AB#642150).
Changes:
- Adjusts requisition line base-quantity alignment in
Inventory Profile Offsettingwhen the only mismatch is attributable to UoM conversion rounding. - Adds a new SCM planning regression test covering a Job Planning Line demand with a non-base purchase UoM and verifying cleanup of reservation entries after deletion.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/Layers/W1/Tests/SCM/SCMPlanningNTFtests.Codeunit.al | Adds a new regression test and helper procedures to reproduce and validate the reservation-entry rounding/deletion scenario. |
| src/Layers/W1/BaseApp/Inventory/Tracking/InventoryProfileOffsetting.Codeunit.al | Adds logic to align requisition line base quantities with demand when small UoM rounding differences occur. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Agentic PR Review - Round 2Recommendation: Accept with SuggestionsWhat this PR doesSince round 1, PR 9034 has been closed, so the duplicate-PR blocker is resolved and PR 9346 is now the single surviving PR channel. The only new AL change is a test comment update in The underlying fix remains correct on its own merits. The rounding guard in Status of previous suggestions
New observations (commits since round 1)None - the new commit only changes the test scenario description and introduces no new code or test-logic issue. Risk assessment and necessityRisk: The runtime change is still in a sensitive planning and reservation flow, but it is narrow and has no public API or event signature change. The round-2 commit is comment-only, so it adds no new regression surface. Necessity: Bug 640455 is a valid Bug with clear repro steps for a non-base purchase UoM leaving incorrect reservation entries and blocking project planning line deletion. The code fix and regression test are needed, and the duplicate channel is resolved. The remaining issue is traceability: the PR body should link the same work item as the test and scenario before merge.
|
qasimikram
left a comment
There was a problem hiding this comment.
Recommendation: Request Changes
S1 - Rounding tolerance misses valid non-base UoMs (High confidence). In InventoryProfileOffsetting.Codeunit.al, the tolerance accounts only for rounding the converted Quantity (Qty. per UoM * 0.00001 / 2), but Requisition Line.Quantity validation then rounds the multiplied base quantity again in UOMMgt.CalcBaseQty. For a valid Qty. per UoM of 1.5 and demand of 1, the round trip is 1 / 1.5 -> 0.66667 -> 1.00001; the difference (0.00001) exceeds the new tolerance (0.0000075), so the base quantity is not aligned and the same reservation inconsistency remains possible. The test only uses Qty. per UoM 12, where the first rounding dominates and the guard happens to pass.
Please include the base-quantity rounding step in the tolerance (respecting Qty. Rounding Precision (Base)) and add a regression case such as 1.5.
Risk: The change is narrow and all required checks pass, but it only fixes a subset of the stated non-base UoM rounding cases in a sensitive reservation path.
Bug 642150: [master][ALL-E] Cannot delete Project Planning Line due to incorrect reservation entries
Fixes AB#642150