Description
Slava Shishkin
2023-10-06 16:15:00 UTC
Created attachment 156634 [details] [review] Bug 35004: Set row.quantity_received to 1 if row.quantity_received is empty and we're in 'cataloguing' mode Before the code changes only field value was set to 1, but "row.quantity_received" still had an undefined value. After correction row.quantity_received set to 1 if it is empty, but only when effective_create_items == 'cataloguing', and after that its value assigned to the form field. To test: 1. Add a new basket. 2. Create an order line 3. Receive shipment and create an invoice 4. Start receiving your order: Verify: - Quantity ordered: X - Quantity received: 1 (pre-filled, don't touch or change it) 5. Click "Confirm" 6. Observe the Receive error popup: "Order ZZZ: No quantity to receive set. No items will be created." 7. Verify that "Order receive" was not happen (received orders remains empty) 8. Apply the patch and make sure your order is received correctly after step 5. Hi Slava, did you test on latest master? This reads like bug 34880. + $("#creator").html(__("Account has been deleted")); This won't work, the __ is only for .js files, not for JavaScript in general. In your test plan, which value did you set for creating items? (In reply to Katrin Fischer from comment #3) > In your test plan, which value did you set for creating items? Standing order? Subscription order? (In reply to Katrin Fischer from comment #2) > Hi Slava, > > did you test on latest master? This reads like bug 34880. Hi Katrin, Yes, I checked this on the latest master. (In reply to Katrin Fischer from comment #4) > > In your test plan, which value did you set for creating items? > > Standing order? > Subscription order? The basket was closed before receiving items. It wasn't "Orders are standing" or "Subscription order". I am sorry, to be late here. I just confirmed this bug in the recent 23.05, possibly in master as well. Created attachment 158334 [details] [review] Bug 35004: Set row.quantity_received to 1 if row.quantity_received is empty and we're in 'cataloguing' mode Before the code changes only field value was set to 1, but "row.quantity_received" still had an undefined value. After correction row.quantity_received set to 1 if it is empty, but only when effective_create_items == 'cataloguing', and after that its value assigned to the form field. To test: 1. Add a new basket. 2. Create an order line 3. Receive shipment and create an invoice 4. Start receiving your order: Verify: - Quantity ordered: X - Quantity received: 1 (pre-filled, don't touch or change it) 5. Click "Confirm" 6. Observe the Receive error popup: "Order ZZZ: No quantity to receive set. No items will be created." 7. Verify that "Order receive" was not happen (received orders remains empty) 8. Apply the patch and make sure your order is received correctly after step 5. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> I have amended the patch removing this change: $("#creator").html(_("Account has been deleted")); $("#creator").html(__("Account has been deleted")); The double undescore for translations is only used in .js files. In .inc and embedded JavaScript code it doesn't work. We still need the single underscore there. Continuing testing. Did a lot of testing, hopefully not missing anything this time: Items in cataloging * ordered 1, receive 1 * ordered 5, receive 2 * standing order, received on multiple invoices * subscription* * subscription + standing order* Items on receive * ordered 1, receive 1 * ordered 5, receive 2 * standing order, received on multiple invoices * subscription* * subscription + standing order* Items on order * ordered 1, receive 1 * ordered 5, receive 2 * standing order, received on multiple invoices * subscription (no items, because it's a subscription order)* * subscription + standing order (no items, because it's a subscription order)* Created attachment 158336 [details] [review] Bug 35004: Set row.quantity_received to 1 if row.quantity_received is empty and we're in 'cataloguing' mode Before the code changes only field value was set to 1, but "row.quantity_received" still had an undefined value. After correction row.quantity_received set to 1 if it is empty, but only when effective_create_items == 'cataloguing', and after that its value assigned to the form field. To test: 1. Add a new basket. 2. Create an order line 3. Receive shipment and create an invoice 4. Start receiving your order: Verify: - Quantity ordered: X - Quantity received: 1 (pre-filled, don't touch or change it) 5. Click "Confirm" 6. Observe the Receive error popup: "Order ZZZ: No quantity to receive set. No items will be created." 7. Verify that "Order receive" was not happen (received orders remains empty) 8. Apply the patch and make sure your order is received correctly after step 5. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Pushed to master for 23.11. Nice work everyone, thanks! Thanks for the quick push! *** Bug 35296 has been marked as a duplicate of this bug. *** Pushed to 23.05.x for 23.05.06 |