Bug 34108 - When items are added on order, item selection gets lost on editing items
Summary: When items are added on order, item selection gets lost on editing items
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Katrin Fischer
URL:
Keywords: regression
Depends on: 8179
Blocks:
  Show dependency treegraph
 
Reported: 2023-06-23 07:32 UTC by Katrin Fischer
Modified: 2023-08-18 13:36 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.03


Attachments
Bug 34108: Preserve checked orders after item editing (1.79 KB, patch)
2023-08-03 12:30 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 34108: Preserve checked orders after item editing (1.84 KB, patch)
2023-08-03 15:27 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 34108: Preserve checked orders after item editing (1.89 KB, patch)
2023-08-03 15:57 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 34108: Preserve checked orders after item editing (1.95 KB, patch)
2023-08-04 12:41 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2023-06-23 07:32:14 UTC
When items are added on receive, you can either set the checkboxes in the item form, or use the quantity received to set them. Then you can edit the selected items using the link in the items table.
With the new multi-receive work, the checkboxes are lost between being sent to the item form and returning.
If you are editing a bigger amount of items, this can be quite tedious and should not happen as sometimes it matters which items are picked (for a specific library, for a specific location etc. for partial deliveries)
Comment 1 Katrin Fischer 2023-06-23 07:33:16 UTC
To test:
* Create a basket with 'items created on receive'
* Add an order line with multiple items to it
* Close basket
* Receive shipment
* Add invoice information
* Receive through receive link in the table
* Check some items
* Click on the "Edit" link and make some change to the item
* Save
--> Checkboxes have disappeared
Comment 2 Tomás Cohen Arazi 2023-07-31 19:03:14 UTC
(In reply to Katrin Fischer from comment #1)
> To test:
> * Create a basket with 'items created on receive'
> * Add an order line with multiple items to it
> * Close basket
> * Receive shipment
> * Add invoice information
> * Receive through receive link in the table
> * Check some items

Just to clarify: following your steps I marked the orderline as including 10 items for "Perl best practices /", but I don't see a list of items to check, but the cataloguing form.

Did you mean adding (say) 3 items using the form and THEN checking them?
Comment 3 Tomás Cohen Arazi 2023-07-31 19:04:07 UTC
Also, it was marked as '22.11', but depending on 8179, could you please check if this is introduced by 8179, or something we just didn't fix with the change?
Comment 4 Katrin Fischer 2023-07-31 19:19:03 UTC
Hm, the problem here is that I confused 'on order' and 'on receive' - must have been a long day.

Revised test plan:

To test:
* Create a basket with 'items on order'
* Add an order line with multiple items to it
* Close basket
* Receive shipment
* Add invoice information
* Receive through receive link in the table
* Check some items using the checkboxes
* Click on the "Edit" link and make some change to the item in the form
* Save
--> Checkboxes have disappeared
Comment 5 Katrin Fischer 2023-07-31 19:20:20 UTC
22.11 was by mistake, it doesn't have the multi-receive. This was intended for master.
Comment 6 Katrin Fischer 2023-07-31 19:22:11 UTC
(In reply to Katrin Fischer from comment #5)
> 22.11 was by mistake, it doesn't have the multi-receive. This was intended
> for master.

I also verfified now that this works in 22.11 - checkboxes are kept, so this is a regression.
Comment 7 Nick Clemens 2023-08-03 12:30:18 UTC
Created attachment 154218 [details] [review]
Bug 34108: Preserve checked orders after item editing

The js that buils the new row after editing expects to receive a
value '_checked' indicating if theitem was selected. The 'item' variable
used to create the row after edit comes from the api and doesn't include this.

We need to inspect the previous html before building the new row to confirm the box wa checked

To test:
 1 - Create a basket with 'items created on receive'
 2 - Add an order line with multiple items to it
 3 - Close basket
 4 - Receive shipment
 5 - Add invoice information
 6 - Receive through receive link in the table
 7 - Check some items
 8 - Click on the "Edit" link and make some change to the item
 9 - Save
10 - Checkboxes have disappeared
11 - Cancel receipt
12 - Apply patch
13 - Reload the page
14 - Repeat 7-9
15 - Checkbox is preserved
Comment 8 Sam Lau 2023-08-03 15:27:52 UTC
Created attachment 154220 [details] [review]
Bug 34108: Preserve checked orders after item editing

The js that buils the new row after editing expects to receive a
value '_checked' indicating if theitem was selected. The 'item' variable
used to create the row after edit comes from the api and doesn't include this.

We need to inspect the previous html before building the new row to confirm the box wa checked

To test:
 1 - Create a basket with 'items created on receive'
 2 - Add an order line with multiple items to it
 3 - Close basket
 4 - Receive shipment
 5 - Add invoice information
 6 - Receive through receive link in the table
 7 - Check some items
 8 - Click on the "Edit" link and make some change to the item
 9 - Save
10 - Checkboxes have disappeared
11 - Cancel receipt
12 - Apply patch
13 - Reload the page
14 - Repeat 7-9
15 - Checkbox is preserved

Signed-off-by: Sam Lau <samalau@gmail.com>
Comment 9 Biblibre Sandboxes 2023-08-03 15:57:03 UTC
Created attachment 154225 [details] [review]
Bug 34108: Preserve checked orders after item editing

The js that buils the new row after editing expects to receive a
value '_checked' indicating if theitem was selected. The 'item' variable
used to create the row after edit comes from the api and doesn't include this.

We need to inspect the previous html before building the new row to confirm the box wa checked

To test:
 1 - Create a basket with 'items created on receive'
 2 - Add an order line with multiple items to it
 3 - Close basket
 4 - Receive shipment
 5 - Add invoice information
 6 - Receive through receive link in the table
 7 - Check some items
 8 - Click on the "Edit" link and make some change to the item
 9 - Save
10 - Checkboxes have disappeared
11 - Cancel receipt
12 - Apply patch
13 - Reload the page
14 - Repeat 7-9
15 - Checkbox is preserved

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Comment 10 Katrin Fischer 2023-08-04 12:41:37 UTC
Created attachment 154262 [details] [review]
Bug 34108: Preserve checked orders after item editing

The js that buils the new row after editing expects to receive a
value '_checked' indicating if theitem was selected. The 'item' variable
used to create the row after edit comes from the api and doesn't include this.

We need to inspect the previous html before building the new row to confirm the box wa checked

To test:
 1 - Create a basket with 'items created on receive'
 2 - Add an order line with multiple items to it
 3 - Close basket
 4 - Receive shipment
 5 - Add invoice information
 6 - Receive through receive link in the table
 7 - Check some items
 8 - Click on the "Edit" link and make some change to the item
 9 - Save
10 - Checkboxes have disappeared
11 - Cancel receipt
12 - Apply patch
13 - Reload the page
14 - Repeat 7-9
15 - Checkbox is preserved

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 11 Katrin Fischer 2023-08-04 12:41:57 UTC
Small patch, great effect - thanks a lot, Nick!
Comment 12 Tomás Cohen Arazi 2023-08-15 09:13:50 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 13 Fridolin Somers 2023-08-17 19:33:50 UTC
Pushed to 23.05.x for 23.05.03
Comment 14 Pedro Amorim 2023-08-18 13:36:26 UTC
Missing bug 8179 on 22.11.x. Doesn't apply. Not pushing.