Bug 29099 - Add support for item bundles in the inventory tool
Summary: Add support for item bundles in the inventory tool
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Martin Renvoize
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 28854
Blocks:
  Show dependency treegraph
 
Reported: 2021-09-23 14:47 UTC by Martin Renvoize
Modified: 2023-06-24 18:25 UTC (History)
3 users (show)

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


Attachments
Bug 29099: Add bundle support to inventory tool (5.23 KB, patch)
2021-09-23 14:51 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 29099: Add bundle support to inventory tool (6.93 KB, patch)
2022-09-23 10:11 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 29099: Add bundle support to inventory tool (7.00 KB, patch)
2023-02-02 14:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 29099: Add Koha objects for item bundle(s) (3.22 KB, patch)
2023-03-22 14:11 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 29099: Add bundle support to inventory tool (7.03 KB, patch)
2023-03-22 14:14 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 29099: Fix item bundle fetch in inventory script (2.19 KB, patch)
2023-03-22 14:14 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2021-09-23 14:47:55 UTC
I chose to split out the inventory tool additions from the bundles bug.. that bug was already big enough ;)
Comment 1 Martin Renvoize 2021-09-23 14:51:46 UTC
Created attachment 125207 [details] [review]
Bug 29099: Add bundle support to inventory tool
Comment 2 Julian Maurice 2022-09-23 10:11:01 UTC
Created attachment 140898 [details] [review]
Bug 29099: Add bundle support to inventory tool

Test plan:
1. Create an item bundle (see bug 28854 comment 458) containing 2 items
   with barcodes B1 and B2
2. Go to the inventory tool
3. Enter B1 inside the barcode list
4. Select the item bundle in "Item location filters" fieldset
5. Submit the form
   In the result table you should see B2 with the problem "Missing (not
   scanned)"
Comment 3 Julian Maurice 2022-09-23 10:12:20 UTC
Patch rebased and reworked to work with bug 28854
Also added unit tests for GetItemsForInventory
Comment 4 Martin Renvoize 2022-10-05 10:10:02 UTC
Thanks for your work here Julian, I'm so bad at remembering unit tests at the moment :(.

Is your customer intending to test and sign this one off.. We don't really use the inventory at all here, so although I'm reasonably confident this achieves what's required, it would be great to hear from someone using it in earnest.

It would be great to see this go in within this cycle to have the feature complete at release time.
Comment 5 Martin Renvoize 2023-02-02 14:26:24 UTC
Created attachment 146009 [details] [review]
Bug 29099: Add bundle support to inventory tool

Test plan:
1. Create an item bundle (see bug 28854 comment 458) containing 2 items
   with barcodes B1 and B2
2. Go to the inventory tool
3. Enter B1 inside the barcode list
4. Select the item bundle in "Item location filters" fieldset
5. Submit the form
   In the result table you should see B2 with the problem "Missing (not
   scanned)"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2023-02-02 14:27:41 UTC
I'd have loved to have seen a customer signoff here.. but I'm confident enough in the code and have tested it's working.. So I'm signing off myself.
Comment 7 Marcel de Rooy 2023-03-17 09:40:44 UTC
(In reply to Martin Renvoize from comment #6)
> I'd have loved to have seen a customer signoff here.. but I'm confident
> enough in the code and have tested it's working.. So I'm signing off myself.

It is not really a trivial one. But lets see.
Looking here now
Comment 8 Marcel de Rooy 2023-03-17 10:59:04 UTC
I think that this needs a bit more attention still but did not yet finish qa on it.

Came across this exception with inventory form:
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: 'koha_myclone.me.biblionumber' isn't in GROUP BY at /usr/share/koha/Koha/Objects.pm line 394
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77

Resuming next week. Fine for me to keep it BLOCKED now.
Comment 9 Marcel de Rooy 2023-03-22 14:09:20 UTC
[1] The following constructs look quite complicated and does not work:
-my $schema = Koha::Database->new()->schema();
-my $item_bundles_rs = Koha::Items->search(
-    {
-        'item_bundles_hosts.item' => { '!=' => undef },
-    },
-    {
-        join => 'item_bundles_hosts',
-        group_by => 'itemnumber',
-    }
-);
-
-my @item_bundles = $item_bundles_rs->as_list;

I am adding a follow-up as proposal to change this code.
Comment 10 Marcel de Rooy 2023-03-22 14:10:22 UTC
General observation:

+    $item_bundle->_result->add_to_item_bundles_hosts({ item => $item1->itemnumber });
+    $item_bundle->_result->add_to_item_bundles_hosts({ item => $item2->itemnumber });
If those were the first lines introducing ->result->add_to_$rel, I might say something about Koha objects. But apparently the door has been opened already for more of those ;)
Comment 11 Marcel de Rooy 2023-03-22 14:11:06 UTC
Created attachment 148550 [details] [review]
Bug 29099: Add Koha objects for item bundle(s)
Comment 12 Marcel de Rooy 2023-03-22 14:12:29 UTC
The choice for the column 'item' on the parent report present difficulties here when you want to go from item to item if you understand what I mean..
Comment 13 Marcel de Rooy 2023-03-22 14:14:13 UTC
Created attachment 148555 [details] [review]
Bug 29099: Add bundle support to inventory tool

Test plan:
1. Create an item bundle (see bug 28854 comment 458) containing 2 items
   with barcodes B1 and B2
2. Go to the inventory tool
3. Enter B1 inside the barcode list
4. Select the item bundle in "Item location filters" fieldset
5. Submit the form
   In the result table you should see B2 with the problem "Missing (not
   scanned)"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Marcel de Rooy 2023-03-22 14:14:16 UTC
Created attachment 148556 [details] [review]
Bug 29099: Fix item bundle fetch in inventory script

Using the newly created Koha objects.
Comment 15 Marcel de Rooy 2023-03-22 14:15:31 UTC
(In reply to Martin Renvoize from comment #6)
> I'd have loved to have seen a customer signoff here.. but I'm confident
> enough in the code and have tested it's working.. So I'm signing off myself.

The inventory form crashed. Please ask for another signoff when submitting adjustments now.
Comment 16 Marcel de Rooy 2023-03-22 14:19:25 UTC
The last follow-up seems to fix the crash.

Another point: The biblio title in the inventory combo may appear double when you have multiple bundles on the same parent biblio. This is confusing. The bundle should probably have its own name?
Comment 17 Marcel de Rooy 2023-03-22 14:20:26 UTC
If you agree with the two new patches, please switch to NSO.
Moving it to FQA now first.
Comment 18 Marcel de Rooy 2023-05-19 08:58:09 UTC
Ping Martin
Comment 19 Katrin Fischer 2023-06-24 18:25:06 UTC
Ping Martin :)