Warehouse 0.6.0: Count stock from photos, a trash for documents and a supplier order preview
Warehouse 0.6.0 lets a stocktake be counted from photos of the shelves, gives every warehouse document a trash, and shows what “Generate supplier orders” will write before it writes anything.
Count a stocktake from photos
A draft stocktake gets a Count from photos button next to adding items. Upload the photos of one place (a shelf, a box, a stack), optionally say where it is and what is on them, and press Propose. An AI model looks at the photos and proposes which catalogue items it sees and how many. Reading takes 20 to 40 seconds as a rule, and the page may be closed in the meantime.
The proposal comes back as a table. You correct items and quantities, tick the rows you agree with and apply them. Nothing reaches the count sheet without Apply. A count far below the stock is unticked and flagged, items no catalogue line fits are listed, and goods kept in packs are counted in packs. Each line now remembers how its number was given: by the stock, by hand or from photos.
Every run is kept with its photos in the stocktake’s Files tab, so a failed run can be retried on the same photos. The panel warns that the photos are sent to an outside AI service.
The button only shows once an endpoint is chosen. The settings page has a new AI: inventory from photos block with AI endpoint, Photos in one batch (10 by default, up to 20 MB each), Most catalogue lines in one request (3000) and Edit the prompt. Only a holder of the AI permission, or an administrator, can choose the endpoint. With the AI module switched off the button is not shown.
A trash for draft documents
Internal orders, supplier orders, goods receipts, goods issues, stocktakes and transfers can be moved to the trash while they are drafts, from the list or the form, with Move to trash. The lists get an Active tab and a Trash tab, a trashed draft can be restored, and a trashed document’s form shows a banner saying when and by whom it was deleted.
A new setting, config :phoenix_kit_warehouse, one_draft_per_source: true, off by default, moves the older live drafts of the same internal order to the trash when a new one is made.
Supplier orders you can check first
Generate supplier orders on a posted internal order now opens a window first. It shows the supplier chosen for each line and why, and the quantity still to order: what is required, minus what was issued, minus the stock on hand, minus what is already ordered. Lines with several suppliers can be assigned by hand, one at a time or ticked together, before Generate. Generation adds what is missing to a supplier’s existing draft for that internal order instead of making a second one. Line explanations from the internal order now carry into the supplier order.
Smaller changes
- A stocktake open in two tabs no longer writes over the other tab’s changes: the second save is refused with a message to reload.
- The item pickers of the stocktake, internal order and transfer forms also show internal-category items.
- The
warehouse.set_stockAPI tool posts nothing when every line already holds the counted quantity, and neither does a stocktake whose counted lines are all unchanged. - In Estonian, “internal order” is now “sisetellimus” everywhere.
Upgrading
Warehouse 0.6 needs PhoenixKit 2.57 or later and Catalogue 0.46 or later, and adds AI 0.25 as a direct dependency (the catalogue already requires it). Run mix phoenix_kit.update: migration V3 adds the table that keeps the photo runs. Nothing else changes on a live site until an AI endpoint is chosen in the settings.
Full release notes: Warehouse 0.6.0
0.6.0 · 24 October 2026
Added
- Photo inventory (#43, #44) — Count from photos on a draft stocktake’s
Items tab uploads the photos of one place (up to
warehouse_inventory_ai_max_photos, 10 by default, 20 MB each, HEIC included); onePhoenixKitAI.describe_image/3call per batch, run in a background task, proposes the catalogue items seen and how many. The person reviews and corrects the proposal as a table and applies the ticked rows; nothing reaches the lines without Apply. Pieces are counted through transparent bags (one entry per kind in a mixed bag), packages and their fill are turned into the item’s unit, an item kept in packs is counted in packs, objects no catalogue line fits are listed, and a typed quantity far below the stock is unticked and flagged. Runs are kept with their photos (in the stocktake’s Storage folder), model, answer and who applied what inphoenix_kit_warehouse_inventory_ai_runs, added by migration chain V3 — runmix phoenix_kit.update; rolling back only re-stamps the marker and keeps the table. A failed run can be retried on the same photos and a late answer is shown on request. Settings:warehouse_inventory_ai_endpoint_uuid(chosen only by anaipermission holder or an administrator),_prompt_uuid(the module’s own prompt, never overwritten once edited),_max_photos,_max_items(3000). The module declares its AI task (ai_tasks/0) for phoenix_kit_ai’s task guard where the ai has one, with its purpose translated (#45). Thanks to timujinne. - Lines record who gave each number (
"counted_by":stock,manual,ai, plus"ai_parts"per photographed place), kept on posting. - Move to trash and a Trash view for every warehouse document (#39, #41) —
internal and supplier orders, goods receipts, goods issues, stocktakes and
transfers: draft-only, with restore, a banner on a trashed document’s form
and activity entries.
trashed: truelist option andcount_trashed_*counters. - One draft per source (#39) —
config :phoenix_kit_warehouse, one_draft_per_source: true(off by default) sends the live drafts of the same internal order (or internal order and supplier) to the trash when a new one is made, and restore can swap. - Supplier order preview and plan (#47) —
SupplierOrderPlanshows the supplier of every line and why, and the quantity still to order (required − issued − on hand − already ordered), before generating. Generation appends to a supplier’s existing live draft instead of replacing it, under the internal order’s lock; draft writes takeexpected_version:so a form opened before an append cannot wipe it. - Line explanations are carried from internal orders into supplier orders and shown on the forms (#40).
Inventories.fingerprint/2andbase_fingerprint:onupdate_draft/3andpost_document/3: a stocktake tab whose warehouse or lines another tab has changed is refused ({:error, :stale}) instead of writing over them.
Changed
- ⚠️ Requires
phoenix_kit ~> 2.57(was~> 2.26 and >= 2.26.1): the photo inventory prepares each photo withPhoenixKit.Modules.Storage.ImageProcessor.preview_jpeg/3, first shipped in 2.57.0. - ⚠️ Requires
phoenix_kit_catalogue ~> 0.46(was~> 0.18): the photo inventory lists only goods (theitem_typesfilter) and counts in the pack, kilogram, litre and cubic metre units, both first shipped in 0.46.0. - New direct dependency
phoenix_kit_ai ~> 0.25(describe_image/3with a strictschema:). The catalogue already requires it, so no new package is installed; it is not inrequired_modules/0— with the ai module off, the photo inventory button is simply not shown. warehouse.set_stockwith every line already at the counted quantity answers"unchanged"and posts no document (no number drawn), and a stocktake whose counted lines are all unchanged posts nothing (#37).- The item pickers of the stocktake, internal order and transfer forms show
internal-category items (
include_internal, honoured by catalogue 0.49+) (#38). - Whole-document refs are kept when importing an internal order into a draft, a combined draft or a goods issue; the draft a line already lies in preselects its supplier.
- “Internal order” is “sisetellimus” throughout the Estonian translation (#42).
- Dependencies refreshed to PhoenixKit 2.64.1 and phoenix_kit_ai 0.26.1.
Fixed
- The photo inventory’s settings offered no endpoint with
phoenix_kit_ai0.26. ai 0.26’sTasks.endpoint_options/1answers%{endpoint: _, fitness: _}per endpoint, a shape the endpoint list did not read, so the list came out empty and no model could be chosen. It now reads it (and still falls back to every enabled endpoint on an ai without the guard). - Conduct saved and posted in two transactions without comparing anything, so an Apply from another tab landing in between was posted unseen; the post now checks the fingerprint its save returned.
- The stocktake fingerprint includes the warehouse, so counts from a tab on the old warehouse cannot reach the new one; changing the warehouse no longer closes a run just started for the new one.
- The supplier order plan reads only the goods receipts that can count for the order instead of every posted receipt, under its locks.
Warehouse 0.6.0. Install or update: {:phoenix_kit_warehouse, "~> 0.6"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.