[29.x] Partial Warehouse Shipment with Lot-Tracked Item Fails on Second Shipment Due to Auto-Populated Bin Code and Item Tracking Quantity Validation Error ("You cannot select more than 0 units") - Copy - #10942
Conversation
Good Sense Reviewer - Round 1Recommendation: AcceptWhat this PR doesThis change clears
Problem-solution fitFit: Strong The change targets the stale bin code that restricts lot availability to the wrong bin during the second partial shipment. It does not broaden normal item tracking calls because non-warehouse-shipment second sources keep their source-line bin. SuggestionsNone. Risk assessment and necessityRisk: The regression surface is sales and purchase warehouse shipment item tracking. Other item tracking entry points keep the existing bin behavior, and no public signature or event signature changes. Necessity: The change is needed because the stale shipment bin can block selecting the remaining tracked quantity. The scope is small and is covered by direct regression tests for the changed sales and purchase paths.
|
c5610b3
Good Sense Reviewer - Round 2Recommendation: AcceptWhat this PR doesSince round 1, the change was narrowed to the sales warehouse-shipment item-tracking path, and the purchase-side edit was removed. The current net diff clears the sales tracking specification bin only when item tracking is opened from a warehouse shipment line. That matches the reported failure: the stale sales-line shipment bin should not limit Select Entries when the remaining lot is still available in the pick bin. The added regression test covers a directed pick location, FEFO, two lots, a first partial shipment, item tracking on the second shipment, and the second pick lines. Problem-solution fitFit: Strong The reported problem is clear and the fix targets the root cause without changing the normal sales-line item tracking entry point. The test follows the important inventory path through shipment posting and the second pick, so the code and coverage fit the scenario well. New observations (commits since round 1)None - I found no new blocking or non-blocking suggestions in the current diff. Risk assessment and necessityRisk: This is an inventory and warehouse posting-adjacent path, so a wrong bin or quantity decision could create incorrect pick or tracking data. The product change is narrow: it only affects sales-line item tracking opened with a warehouse shipment line as the second source, and the second-source quantity is still passed to the item tracking page. Necessity: The change is needed because the stale sales-line bin can block selection of the remaining lot during the second partial warehouse shipment. The scope is appropriate for the bug, and the new test exercises the money/inventory-sensitive path that would regress.
|
Good Sense Reviewer - Round 3Recommendation: Request ChangesWhat this PR doesThis PR clears the copied sales-line bin code before item tracking opens from a warehouse shipment line. That keeps Select Entries from being limited to the bin used by the first partial shipment. The production change is targeted, but the regression test still misses one modal page in the Select Entries flow. Because the test cannot handle the summary page that opens next, it does not reliably prove the fix. Status of previous suggestionsNone - the previous round did not carry open suggestions. New observations (commits since round 2)S1 (🔴 High): Add the missing summary page handler Risk assessment and necessityRisk: The production change is narrow to sales item tracking opened from warehouse shipment lines, but it affects warehouse shipment item tracking. The intended regression coverage is important because this flow moves tracked inventory through partial shipment and pick creation. Necessity: The production change is needed because a stale bin code can block selection of the remaining tracked inventory for a second partial shipment. The test also needs to run through the full Select Entries modal chain so the fix is protected.
|
Good Sense Reviewer - Round 4Recommendation: AcceptWhat this PR doesSince round 3, the test adds the missing Item Tracking Summary modal handler and includes it in the handler list for the Select Entries flow. The production change is unchanged: it clears the copied sales-line bin code only when item tracking is opened from a warehouse shipment line. The new handler matches the modal page opened by Select Entries, so the regression test can now continue through the summary page and verify that the remaining lot reaches the second pick. Status of previous suggestions
New observations (commits since round 3)None - the new commit only addresses the previous test-handler gap. Risk assessment and necessityRisk: The incremental change is test-only and adds the modal handler that the existing Select Entries flow requires. The production risk remains limited to sales warehouse-shipment item tracking, where the change avoids using a stale source-line bin as an availability filter. Necessity: The production change is needed because a stale bin can block selection of the remaining tracked inventory for a second partial shipment. The test-handler change is needed so the regression test can run through the full modal chain that exercises the fix.
|
Predrag Maricic (PredragMaricic)
left a comment
There was a problem hiding this comment.
The stale sales-line bin is cleared only for warehouse-shipment second-source item tracking, preserving existing behavior for other entry points. The regression test exercises the complete partial-shipment flow and verifies that the remaining lot and quantity reach both lines of the second pick. The previously missing Item Tracking Summary modal handler is now included.
Good Sense Reviewer - Round 5Recommendation: AcceptWhat this PR doesSince round 4, the regression test now creates lot expiration dates relative to The new test-only change keeps FEFO ordering stable and avoids a date-sensitive test failure. The full fix still matches the reported problem because the stale shipment bin no longer limits availability for the second partial shipment. Status of previous suggestions
New observations (commits since round 4)None - the new commit only makes the regression test dates relative to Risk assessment and necessityRisk: The round-5 change is test-only. The production risk remains limited to sales warehouse-shipment item tracking, with no public API or event signature change. Necessity: The production fix is needed because a stale shipment bin can block selection of the remaining tracked lot for a second partial shipment. The date change is needed to keep the regression test stable across build contexts.
|
Predrag Maricic (PredragMaricic)
left a comment
There was a problem hiding this comment.
S1 - Exercise the failing Select Entries path (High confidence)
The regression test creates a full WMS location and enables Lot Warehouse Tracking. With an open warehouse shipment, ItemTrackingLines.SetWarehouseControls() calls ItemTrkgIsManagedByWhse(), which returns true and sets InsertIsBlocked := true. The Select Entries action therefore exits immediately, before ItemTrackingDataCollection.SelectMultipleTrackingNo() and the failing Item Tracking Summary flow are reached.
The latest commit confirms this gap by removing ItemTrackingSummaryPageHandler because it was not called. The test can still pass because FEFO selects the remaining lot while creating the second pick, independently of the no-op Select Entries invocation. It therefore does not prove that clearing TrackingSpecification."Bin Code" fixes the reported "You cannot select more than 0 units" error.
Please align the fixture with the customer configuration where Select Entries is enabled, require the Item Tracking Summary handler to run, and then verify that the chosen lot flows to the pick. This is required coverage for the behavior change.
|
Remember to mirror corrections to the master branch. |
Good Sense Reviewer - Round 6Recommendation: Request ChangesWhat this PR doesSince round 5, the production fix is unchanged, but the regression test no longer declares the handler for the item tracking summary page. The production change still clears the copied sales-line bin when item tracking is opened from a sales warehouse shipment line, so Select Entries can calculate availability without the stale bin filter. The code path is narrow: warehouse shipment lines for sales call Status of previous suggestions
New observations (commits since round 5)S1 (🔴 High): Restore the summary page handler Risk assessment and necessityRisk: The production risk remains limited to sales warehouse-shipment item tracking for lot/serial tracked sales lines. The current round risk is in the test: the new regression coverage can fail before it reaches the assertions. Necessity: The production fix is needed because a stale shipment bin can block selection of the remaining tracked lot for a second partial shipment. The handler is also needed so the regression test can complete the Select Entries workflow.
|
Good Sense Reviewer - Round 7Recommendation: AcceptWhat this PR doesThe PR clears the copied sales-line bin code before item tracking opens from a sales warehouse shipment line. Since round 6, the regression test now registers and implements the summary page handler used by Select Entries, so the test can drive the modal page and verify the remaining lot assignment. The fix is narrow and matches the failing flow. Status of previous suggestions
New observations (commits since round 6)None - changes only addressed the previous suggestion. Risk assessment and necessityRisk: The regression surface is sales warehouse shipment item tracking with a second source. The code change is limited to that second-source path, does not change public signatures, and the test covers the partial shipment, Select Entries, second pick, and lot assignment flow. Necessity: The change is needed because the stale bin code blocks selecting remaining lot quantity on the second partial shipment. The scope is right: it removes only the stale availability filter for warehouse shipment item tracking and adds a focused regression test.
|
Bug 648521: [ALL-E] [29.x] Partial Warehouse Shipment with Lot-Tracked Item Fails on Second Shipment Due to Auto-Populated Bin Code and Item Tracking Quantity Validation Error ("You cannot select more than 0 units") - Copy
Fixes AB#648521
Issue:
The second partial warehouse shipment of a lot-tracked item fails while assigning item tracking with the error: “You cannot select more than 0 units.”
Cause:
After the first partial shipment, a bin code is populated on the sales line. When item tracking is opened for the subsequent warehouse shipment, InitFromSalesLine() copies this bin code to the tracking specification. Item availability is then incorrectly restricted to that bin, even though the remaining lot-tracked quantity is available in another bin.
Solution:
In CallItemTrackingSecondSource(), clear TrackingSpecification."Bin Code" when the second source is a warehouse shipment line. This prevents item tracking from inheriting the stale sales-line bin and allows the remaining quantity to be selected from the appropriate warehouse bin.