Skip to content

Add printable barcode stickers for storage location objects#72

Open
ramonski wants to merge 1 commit into
2.xfrom
feature/storage-location-stickers
Open

Add printable barcode stickers for storage location objects#72
ramonski wants to merge 1 commit into
2.xfrom
feature/storage-location-stickers

Conversation

@ramonski

@ramonski ramonski commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Description of the issue/feature this PR addresses

Storage location objects (facilities, positions, containers and samples containers) could not be printed as barcode labels. This PR adds a printable Code128 sticker for storage locations and exposes a "Print stickers" action on the storage listings.

Current behavior before PR

There is no way to print a barcode label for a storage location. The @@sticker view has no template for storage objects.

Desired behavior after PR is merged

  • A new StorageLocation_50x30mm sticker template renders a Code128 barcode of the location getId(), with the id and the breadcrumb full title as human-readable text. It is registered via <plone:static type="stickers" name="senaite.storage">, so its template id is senaite.storage:StorageLocation_50x30mm.pt.
  • A GetStorageStickers adapter provides IGetStickerTemplates for IStorageFacility, IStoragePosition, IStorageContainer and IStorageSamplesContainer, so the storage location template is the one offered for those types.
  • The storage listings (StorageListing.before_render) gain a "Print stickers" action in every review state. It reuses the existing generic workflow_action?action=print_stickers redirect, so no new workflow-action code is needed.

The barcode payload is the storage object id, which is the same value a barcode scanner reads back when looking up a storage location.

Pairs with senaite/senaite.core#2974: without that fix, storage listings (which had no sticker adapter before this PR) would fall back to offering the entire sticker catalog. With the adapter added here, the storage template is the only one offered regardless.

Covered by a new Stickers.rst doctest (adapter resolution, @@sticker rendering, and the listing action).

@ramonski ramonski force-pushed the feature/storage-location-stickers branch 3 times, most recently from bcc3663 to 2445aca Compare July 5, 2026 06:32
Storage locations (facilities, positions, containers and samples
containers) can now be printed as Code128 barcode stickers. A new
50x30mm sticker template encodes the location getId() with the id and
title as human-readable text.

An IGetStickerTemplates adapter offers the template for every storage
location type. The storage listings expose a Print stickers action
(reusing the generic workflow_action print_stickers redirect), and each
storage location type gains a Stickers preview object action so the
sticker can be printed from the object view. An upgrade step reimports
the type actions on existing installs.

The barcode payload matches the id the scanner reads back when looking
up a storage location.
@ramonski ramonski force-pushed the feature/storage-location-stickers branch from 2445aca to 703f0c3 Compare July 5, 2026 06:32
@ramonski ramonski requested a review from xispa July 5, 2026 06:38
@ramonski ramonski added the Enhancement ✨ Improvement to existing functionality label Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement ✨ Improvement to existing functionality

Development

Successfully merging this pull request may close these issues.

1 participant