Add printable barcode stickers for storage location objects#72
Open
ramonski wants to merge 1 commit into
Open
Conversation
bcc3663 to
2445aca
Compare
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.
2445aca to
703f0c3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
@@stickerview has no template for storage objects.Desired behavior after PR is merged
StorageLocation_50x30mmsticker template renders a Code128 barcode of the locationgetId(), 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 issenaite.storage:StorageLocation_50x30mm.pt.GetStorageStickersadapter providesIGetStickerTemplatesforIStorageFacility,IStoragePosition,IStorageContainerandIStorageSamplesContainer, so the storage location template is the one offered for those types.StorageListing.before_render) gain a "Print stickers" action in every review state. It reuses the existing genericworkflow_action?action=print_stickersredirect, 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.rstdoctest (adapter resolution,@@stickerrendering, and the listing action).