Repository navigation
[Main][All-E][Subcontracting] Create Return reports nothing to return when an open return order exists - #14605
Conversation
|
This test contains two separate WHEN actions: creating the return order and attempting the duplicate creation. Its name does not declare a flow or defect-then-fix shape, so split the claims into focused tests or rename and structure the procedure as an explicit flow. Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v10.0.7 |
1 similar comment
|
This test contains two separate WHEN actions: creating the return order and attempting the duplicate creation. Its name does not declare a flow or defect-then-fix shape, so split the claims into focused tests or rename and structure the procedure as an explicit flow. Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v10.0.7 |
|
The changed partial-shipment tests each contain two WHEN actions: creating the return and then trying to create it again. Because the procedure names do not declare a flow or defect-then-fix relationship, split the claims into focused tests or rename and structure the procedure explicitly as a dependent flow test. Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v10.0.7 |
Good Sense Reviewer - Round 1Recommendation: AcceptWhat this PR doesThe change replaces the misleading no-returnable-stock error with guidance when an open subcontracting return transfer order already exists. It keeps the existing duplicate-return restriction rather than enabling additional return cycles. The new check runs only after both component and WIP eligibility checks find nothing to create. It filters transfer lines to the current purchase order, return orders, and non-derived lines, then checks the linked header's Open status. This catches the remaining return line after another component line is deleted, while preserving the original error when no open return exists. Successful creation, quantities, reservations, and posting logic remain unchanged. Problem-solution fitFit: Strong The reported scenario explicitly allows retaining the one-return restriction if the error explains the existing open return and how to proceed. The implementation and the new deleted-component regression test directly cover that outcome. SuggestionsNone. Risk assessment and necessityRisk: The regression surface is the diagnostic shown after an unsuccessful subcontracting return-creation attempt. The additional read-only lookup is scoped to the purchase order and does not change inventory quantities, posting, public signatures, events, or stored data. Released return orders retain the existing diagnostic because this change specifically checks Open status. Necessity: Without this change, deleting one component from an otherwise open return leaves available material blocked by the purchase-line duplicate check, but users are incorrectly told that nothing can be returned. Explaining the existing document is a narrowly scoped improvement that avoids changing the supported return process.
|
Stefan Sosic (StefanSosic)
left a comment
There was a problem hiding this comment.
Thanks for making this message clearer. Two points inline. It would also help to add a test where the existing return is released or shipped before the second attempt, since that is the common real-world case.
|
| ReturnTransferLine: Record "Transfer Line"; | ||
| TransferHeader: Record "Transfer Header"; | ||
| WorkCenter: array[2] of Record "Work Center"; | ||
| PurchaseOrderPage: TestPage "Purchase Order"; |
There was a problem hiding this comment.
This test codeunit mixes a TestPage-driven test with direct business-logic test calls: OpenReturnWithDeletedComponentExplainsExistingReturnOrder drives PurchaseOrderPage, while the adjacent new test calls CreateReturnTransferOrderForPurchaseOrder directly. Separate UI-layer and logic-layer tests into different codeunits so failures identify the layer under test.
Knowledge:
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v10.0.7
|
CreateReturnTransferOrderAfterPartialShipOfOutbound contains two distinct WHEN actions: it creates a return transfer order and then attempts to create a duplicate. The procedure name does not declare a flow or defect-then-fix relationship; split the claims into focused tests or explicitly model the procedure as a permitted flow test. Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v10.0.7 |
|
CreateReturnTransferOrderAfterPartialShipOfOutboundDirectTransfer contains two distinct WHEN actions: it creates a return transfer order and then attempts to create a duplicate. The procedure name does not declare a flow or defect-then-fix relationship; split the claims into focused tests or explicitly model the procedure as a permitted flow test. Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v10.0.7 |
Bug 660833: [Main][All-E][Subcontracting] Create Return reports nothing to return when an open return order exists
Fixes AB#660833
Issue :- Create Return from Subcontractor displays “Nothing to create” when an open return order exists with one component line deleted, even though that component remains available at the subcontractor.
Cause :- The duplicate-return check operates at the subcontracting purchase-line level. A remaining return line blocks return creation for other components on the same purchase line, triggering the generic “Nothing to create” error.
Solution :- Retain the existing duplicate-return restriction, but detect the open return order and display a clear message identifying the purchase order and instructing the user to complete or delete the existing return order. Added regression coverage for the deleted-component scenario and updated existing tests to expect the new message.