Bug 38262 - Add additional fields to Vendors
Summary: Add additional fields to Vendors
Status: Passed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Matt Blenkinsop
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
: 28218 (view as bug list)
Depends on: 38010 38446 38662 41063 35287
Blocks: 38290 40192 41151
  Show dependency treegraph
 
Reported: 2024-10-24 15:25 UTC by Matt Blenkinsop
Modified: 2025-10-31 07:44 UTC (History)
6 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement enables adding additional fields to vendors (Koha administration > Additional parameters > Additional fields > Acquisitions > Vendors (aqbooksellers:vendor)).
Version(s) released in:
Circulation function:


Attachments
Bug 38262: Update API specs (2.51 KB, patch)
2024-12-04 10:18 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 38262: Update object classes (7.55 KB, patch)
2024-12-04 10:18 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 38262: Update UI (10.03 KB, patch)
2024-12-04 10:18 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 38262: Update API specs (2.37 KB, patch)
2024-12-19 12:25 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 38262: Update object classes (7.42 KB, patch)
2024-12-19 12:25 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 38262: Update UI (10.00 KB, patch)
2024-12-19 12:25 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 38262: Update API specs (2.23 KB, patch)
2025-04-03 13:59 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 38262: Update object classes (8.06 KB, patch)
2025-04-03 13:59 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 38262: Update UI (11.30 KB, patch)
2025-04-03 13:59 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 38262: Update API specs (2.23 KB, patch)
2025-05-19 13:23 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 38262: Update object classes (6.80 KB, patch)
2025-05-19 13:23 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 38262: Update UI (11.73 KB, patch)
2025-05-19 13:23 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 38262: Update API specs (2.27 KB, patch)
2025-06-06 02:48 UTC, David Nind
Details | Diff | Splinter Review
Bug 38262: Update object classes (6.83 KB, patch)
2025-06-06 02:48 UTC, David Nind
Details | Diff | Splinter Review
Bug 38262: Update UI (11.77 KB, patch)
2025-06-06 02:48 UTC, David Nind
Details | Diff | Splinter Review
Bug 38262: Update API specs (2.27 KB, patch)
2025-06-06 02:50 UTC, David Nind
Details | Diff | Splinter Review
Bug 38262: Update object classes (6.83 KB, patch)
2025-06-06 02:50 UTC, David Nind
Details | Diff | Splinter Review
Bug 38262: Update UI (11.77 KB, patch)
2025-06-06 02:50 UTC, David Nind
Details | Diff | Splinter Review
Bug 38262: Update API specs (2.27 KB, patch)
2025-10-21 12:23 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 38262: Update object classes (6.84 KB, patch)
2025-10-21 12:23 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 38262: Update UI (3.29 KB, patch)
2025-10-21 12:23 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 38262: Update UI (3.35 KB, patch)
2025-10-23 14:03 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 38262: Update UI (3.68 KB, patch)
2025-10-23 14:52 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 38262: Update UI (4.09 KB, patch)
2025-10-23 16:33 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 38262: Update API specs (2.27 KB, patch)
2025-10-23 17:50 UTC, David Nind
Details | Diff | Splinter Review
Bug 38262: Update object classes (6.83 KB, patch)
2025-10-23 17:50 UTC, David Nind
Details | Diff | Splinter Review
Bug 38262: Update UI (4.09 KB, patch)
2025-10-23 17:50 UTC, David Nind
Details | Diff | Splinter Review
Screenshots for Bug 38262 – Additional fields for vendors (90.44 KB, application/pdf)
2025-10-23 18:09 UTC, David Nind
Details
Bug 38262: Add extended attributes support to vendors API specification (2.79 KB, patch)
2025-10-31 07:33 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38262: Enable additional fields support for acquisition vendors (7.54 KB, patch)
2025-10-31 07:33 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38262: Add additional fields UI support for acquisition vendors (5.12 KB, patch)
2025-10-31 07:33 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Blenkinsop 2024-10-24 15:25:43 UTC
We should add additional fields capability to Vendors following the Vue migration
Comment 1 Matt Blenkinsop 2024-12-04 10:18:10 UTC
Created attachment 175147 [details] [review]
Bug 38262: Update API specs
Comment 2 Matt Blenkinsop 2024-12-04 10:18:12 UTC
Created attachment 175148 [details] [review]
Bug 38262: Update object classes
Comment 3 Matt Blenkinsop 2024-12-04 10:18:14 UTC
Created attachment 175149 [details] [review]
Bug 38262: Update UI
Comment 4 Matt Blenkinsop 2024-12-19 12:25:29 UTC
Created attachment 175712 [details] [review]
Bug 38262: Update API specs
Comment 5 Matt Blenkinsop 2024-12-19 12:25:32 UTC
Created attachment 175713 [details] [review]
Bug 38262: Update object classes
Comment 6 Matt Blenkinsop 2024-12-19 12:25:34 UTC
Created attachment 175714 [details] [review]
Bug 38262: Update UI
Comment 7 Mathieu Saby 2025-02-10 10:21:07 UTC
Could you add a test plan please?
Comment 8 Caroline Cyr La Rose 2025-04-03 13:37:49 UTC
Patch doesn't apply

Error message says 

Patch failed at 0001 Bug 38262: Update API specs
Comment 9 Matt Blenkinsop 2025-04-03 13:59:38 UTC
Created attachment 180558 [details] [review]
Bug 38262: Update API specs
Comment 10 Matt Blenkinsop 2025-04-03 13:59:43 UTC
Created attachment 180559 [details] [review]
Bug 38262: Update object classes
Comment 11 Matt Blenkinsop 2025-04-03 13:59:50 UTC
Created attachment 180560 [details] [review]
Bug 38262: Update UI
Comment 12 Matt Blenkinsop 2025-04-03 14:01:39 UTC
Test plan to follow, updating the bug dependencies first
Comment 13 Matt Blenkinsop 2025-05-19 13:23:37 UTC
Created attachment 182602 [details] [review]
Bug 38262: Update API specs
Comment 14 Matt Blenkinsop 2025-05-19 13:23:40 UTC
Created attachment 182603 [details] [review]
Bug 38262: Update object classes
Comment 15 Matt Blenkinsop 2025-05-19 13:23:42 UTC
Created attachment 182604 [details] [review]
Bug 38262: Update UI
Comment 16 David Nind 2025-06-06 02:48:15 UTC
Created attachment 183026 [details] [review]
Bug 38262: Update API specs

Signed-off-by: David Nind <david@davidnind.com>
Comment 17 David Nind 2025-06-06 02:48:18 UTC
Created attachment 183027 [details] [review]
Bug 38262: Update object classes

Signed-off-by: David Nind <david@davidnind.com>
Comment 18 David Nind 2025-06-06 02:48:22 UTC
Created attachment 183028 [details] [review]
Bug 38262: Update UI

Signed-off-by: David Nind <david@davidnind.com>
Comment 19 David Nind 2025-06-06 02:50:18 UTC
Created attachment 183029 [details] [review]
Bug 38262: Update API specs

Signed-off-by: David Nind <david@davidnind.com>
Comment 20 David Nind 2025-06-06 02:50:22 UTC
Created attachment 183030 [details] [review]
Bug 38262: Update object classes

Signed-off-by: David Nind <david@davidnind.com>
Comment 21 David Nind 2025-06-06 02:50:26 UTC
Created attachment 183031 [details] [review]
Bug 38262: Update UI

Signed-off-by: David Nind <david@davidnind.com>
Comment 22 David Nind 2025-06-06 02:53:48 UTC
Testing notes (using KTD):
1. Apply the patch
2. Rebuild everything: yarn build
3. Restart everything: restart_all
4. Go to Koha administration > Additional parameters > Additional fields.
5. Under the additional fields for acquisitions, note that there is a new option: Vendors (aqbooksellers:vendor).
6. Add two new fields for vendors:
   - a text field
   - a field linked to an authorized value category, for example YES_NO
7. Edit an existing vendor (My Vendor) to add values for the additional fields you created.
8. Note that these are shown in a new section on the vendor details page, "Additional fields".
9. Add a new vendor, and add a value for only one of the additional fields. 
10. Note that on the vendor details page, only additional fields that have a value are shown.
Comment 23 Katrin Fischer 2025-06-10 13:29:33 UTC
*** Bug 28218 has been marked as a duplicate of this bug. ***
Comment 24 Martin Renvoize (ashimema) 2025-10-07 10:42:35 UTC
Can we get a rebase here now that the blocker vue bug is in?
Comment 25 Matt Blenkinsop 2025-10-21 12:23:47 UTC
Created attachment 188213 [details] [review]
Bug 38262: Update API specs

Signed-off-by: David Nind <david@davidnind.com>
Comment 26 Matt Blenkinsop 2025-10-21 12:23:49 UTC
Created attachment 188214 [details] [review]
Bug 38262: Update object classes

Signed-off-by: David Nind <david@davidnind.com>
Comment 27 Matt Blenkinsop 2025-10-21 12:23:51 UTC
Created attachment 188215 [details] [review]
Bug 38262: Update UI

Signed-off-by: David Nind <david@davidnind.com>
Comment 28 Matt Blenkinsop 2025-10-23 14:03:20 UTC
Created attachment 188364 [details] [review]
Bug 38262: Update UI

Signed-off-by: David Nind <david@davidnind.com>
Comment 29 Matt Blenkinsop 2025-10-23 14:52:28 UTC
Created attachment 188366 [details] [review]
Bug 38262: Update UI

Signed-off-by: David Nind <david@davidnind.com>
Comment 30 Matt Blenkinsop 2025-10-23 16:33:12 UTC
Created attachment 188377 [details] [review]
Bug 38262: Update UI

Signed-off-by: David Nind <david@davidnind.com>
Comment 31 David Nind 2025-10-23 17:50:15 UTC
Created attachment 188384 [details] [review]
Bug 38262: Update API specs

Signed-off-by: David Nind <david@davidnind.com>
Comment 32 David Nind 2025-10-23 17:50:18 UTC
Created attachment 188385 [details] [review]
Bug 38262: Update object classes

Signed-off-by: David Nind <david@davidnind.com>
Comment 33 David Nind 2025-10-23 17:50:22 UTC
Created attachment 188386 [details] [review]
Bug 38262: Update UI

Signed-off-by: David Nind <david@davidnind.com>
Comment 34 David Nind 2025-10-23 18:08:39 UTC
Some minor things I noticed during sign off - see screenshots attached separately:

1. When entering repeatable fields for a vendor, there is no spacing between the Clear and + New buttons.

2. In the list of vendors, repeatable fields uses a comma to separate values, instead of listing on separate lines.

3. On the vendor details page, the alignment of the additional field labels and values doesn't look quite right to me.


Note for documentation, for repeatable fields it uses the updated select field input form to add multiple values for a field.
Comment 35 David Nind 2025-10-23 18:09:54 UTC
Created attachment 188388 [details]
Screenshots for Bug 38262 – Additional fields for vendors
Comment 36 Martin Renvoize (ashimema) 2025-10-31 07:15:42 UTC
I agree with David, whilst the functionality works we have some UX improvements to make/bugs to fix.

The 'Clear' and 'New' spacing does look odd and could be improved upon.. I also find that clicking 'New' next to a field clone that field AND it's content to a new field.. I think this should create a new empty repeatable field input instead.

I think both of these things should be handled on their own bug however.
Comment 37 Martin Renvoize (ashimema) 2025-10-31 07:33:55 UTC
Created attachment 188754 [details] [review]
Bug 38262: Add extended attributes support to vendors API specification

Updates the OpenAPI definitions to support additional fields on vendor
records.

This adds:
- extended_attributes array field to vendor schema definition
- _strings field for localized/computed string representations
- extended_attributes and +strings to available embed options

These changes allow the API to expose and accept additional field data
when retrieving or modifying vendor records via the REST API.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 38 Martin Renvoize (ashimema) 2025-10-31 07:33:57 UTC
Created attachment 188755 [details] [review]
Bug 38262: Enable additional fields support for acquisition vendors

Implements backend support for additional fields on vendor records by:
- Adding AdditionalFields mixin to Bookseller/Booksellers classes
- Defining additional_field_values and extended_attributes relationships
  in Aqbookseller schema with proper table name filtering
- Updating REST API controller to handle extended_attributes during
  vendor creation and updates
- Adding vendor to AdditionalField resource type mapping

This provides the ORM-level support needed for vendors to have custom
additional fields, matching the existing pattern used for other resource
types like agreements, packages, and orders.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 39 Martin Renvoize (ashimema) 2025-10-31 07:33:59 UTC
Created attachment 188756 [details] [review]
Bug 38262:  Add additional fields UI support for acquisition vendors

Updates staff interface to expose additional fields functionality for
vendor records:
- Adds "Vendors" (aqbooksellers:vendor) to searchable tables list in
  additional fields administration page
- Configures VendorResource.vue to fetch extended_attributes with
  proper embeds (+strings for localized values)
- Sets extendedAttributesFieldGroup to display fields in "Details" tab
- Cleans up _strings computed field during vendor save operations

This completes the frontend implementation allowing staff to create,
manage, and view custom additional fields on vendor records.

Test plan:
1) Go to Administration > Additional fields and add an additional field for Vendors
2) Navigate to 'Acquisitions' and click 'New vendor'
3) Fill out the form, making sure to add something into your new additional field
4) Hit save
5) View and Edit your new Vendor and confirm that the additional field
   values appear and update as expected

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>