InvenTree Loan Manager
A loan and return management plugin for InvenTree 1.6+ (developed and tested against InvenTree 1.7.4). It adds a complete request → approval → handout → return workflow with audit history, barcode/QR support, due-date reminders, and a role-aware interface for requesters and loan desk staff.
Features
- A public request catalogue that works without an InvenTree account.
- Browse loanable parts by category or search, open part details, and inspect available stock items before adding them to a request.
- Anonymous requesters enter their own name, email, phone, organisation and ID, so no InvenTree user account is required.
- Requesters sign at submission. The loan desk captures a second signature at handout, and a third at return.
- Approvers can review, approve, and reject requests.
- The admin console has a View action for every request, showing requester details, purpose, dates, requested items, notes and the submitted signature before approval or handout.
- Loan desk staff can hand out items by scanning barcodes or searching the catalog.
- Trackable/serialized parts are loaned as whole units and returned in full. Non-trackable parts support partial quantities; split items are moved to the loan location and returned to their original location and status.
- Items move to a dedicated On Loan location and receive an On Loan status.
- While on loan, stock items are excluded from availability and normal allocation flows.
- Direct edits, moves, quantity changes, allocation, and deletion of loaned items are blocked by plugin validation.
- Returns support full or partial quantities, condition notes, and restoring the original location and status.
- Every request, decision, handout, reminder, renewal, loss, and return is recorded in an append-only audit timeline.
- Every anonymous request gets a secret tracking link showing its status, loan progress, and signatures.
- QR codes identify loans; printed receipts include the QR, due date, and captured signatures.
- Barcode scanning supports USB/keyboard scanners and camera scanning where the
browser exposes
BarcodeDetector. - Optional email notifications; in-app notifications are always available.
- Scheduled due-soon and overdue reminders.
- CSV export for requests and loans.
- Responsive, accessible interface with light and dark mode support.
Requirements
- InvenTree 1.6+ (
MIN_VERSION = 1.6.0,MAX_VERSION = 1.7.99)- InvenTree 1.5.x does not support plugin-defined React routes, so the native Loans tab requires an upgrade to 1.6 or newer.
- Python 3.10+
- The global settings
ENABLE_PLUGINS_APP,ENABLE_PLUGINS_URL, andENABLE_PLUGINS_INTERFACEmust be enabledENABLE_PLUGINS_APPis required for the plugin's models and migrations.ENABLE_PLUGINS_INTERFACEis required for the Loans tab and native page.
- The public request page (
/plugin/loan/request/) does not require an InvenTree account. It must be reachable from the network that will use it. - Optional for camera scanning: a browser with
BarcodeDetectorsupport
Upgrading from 1.5.x: enable
ENABLE_PLUGINS_APPbefore restarting. Without it the plugin can appear in the list but its Django app, tables, and URLs are never registered, which produces the intermittent empty/broken pages.
Installation
As a Python package
pip install inventree-loan
Then restart InvenTree, open the plugin management page
(/web/settings/admin/plugin), find InvenTree Loan Manager, and activate it.
Editable development install
pip install -e .
Restart the InvenTree server after installation.
Docker development workflow
When InvenTree runs in Docker, the container filesystem is ephemeral. Keep the
editable install in a mounted plugin directory and record it in
data/plugins.txt:
-e /home/inventree/data/plugins/inventree-loan
Plugin JavaScript, CSS, and templates are served directly from the installed
package through the plugin's own URL (/plugin/loan/assets/...). They therefore
do not depend on collectplugins and are not left stale by the static-file
cache. Python and template changes need a restart because plugins are discovered
at startup:
docker restart inventree-server inventree-worker
Database migration
The plugin uses its own Django app and migrations. After activating the plugin, run the InvenTree update/migration command for your deployment, for example:
invoke update
or, in a source install:
python manage.py migrate
Using the plugin
The plugin adds a Loans tab to the InvenTree navigation bar, a Loans card to the dashboard widget list, and a Loan Manager spotlight action.
- Request equipment (
/plugin/loan/request/) is the public catalogue. It requires no account. It uses an InvenTree-style table with a collapsible category tree, category counts that include subcategories, search, barcode input, pagination, and a request drawer. Requesters open item details, choose available stock, enter their contact details, sign, and submit. The confirmation shows the reference code, tracking link, and a printable request receipt. - Track a request (
/plugin/loan/track/) lets an anonymous requester enter the reference code and email address to open their request. - Request status (
/plugin/loan/track/<token>/) shows the request, loan dates, decisions, and captured signatures. - Loans (navigation) opens a native InvenTree page at
/web/plugin/loan/management. It is rendered inside the normal InvenTree layout, so the header, navigation, theme, and user menu behave exactly like the Stock or Parts pages. Requests and loans use searchable, filterable, sortable tables with pagination and CSV export; summary cards show pending, approved, active and overdue counts. Signed-in requesters use the same page for their requests and loans; the old server-rendered My Requests pages redirect here, so there is only one version. - Request details (
/web/plugin/loan/requests/<pk>) is a full native page, like a build-order detail page. It shows requester/contact details, purpose, dates, lines, signatures, stock allocations, part/stock links, approval and handout actions, and print buttons for request/handout/return receipts. - Loans (dashboard widget) provides a requester shortcut and an Open loan desk button which opens the same native page.
- The plugin settings page (Admin Center → Plugins → InvenTree Loan Manager) uses the same native console for initial setup.
The native console adapts to the signed-in user's loan role: requesters see their own requests and loans, while loan staff additionally see the handout, staff, setup, and audit-history tabs. Handout and return dialogs require the borrower's signature. The Staff tab searches InvenTree users by name, username or email, so you do not need to know the exact username.
Initial setup
The plugin needs two stock objects:
- A dedicated On Loan stock location.
- A custom On Loan stock status whose logical value is
Quarantined(so InvenTree treats loaned items as unavailable).
Run the setup action from the Setup tab of the Loan Manager console, or use the management command:
python manage.py loan_setup --create-location --location-name "On Loan"
The command is idempotent and can be re-run safely. It creates the custom status, creates or selects the location, and saves the location to the plugin settings.
The custom status is what makes an item unavailable. The location keeps the stock history and the return path clear. If the custom status cannot be created, the plugin falls back to InvenTree's built-in
Quarantinedstatus.
Staff roles
The plugin has its own roles, separate from InvenTree's stock roles:
| Role | Capabilities |
|---|---|
| Approver | View all requests/loans, approve or reject requests |
| Loan desk | Everything an approver can do, plus hand out, return, renew, mark lost |
| Loan administrator | Everything, plus manage staff and plugin setup |
Superusers always have full plugin access.
Grant the first role from the Staff tab of the Loan Manager console or with:
python manage.py loan_add_manager <username> --role admin
Only a superuser can grant the Loan administrator role through the web UI. The last active administrator cannot be demoted or removed.
Optional core stock permission
By default, plugin roles govern handout and return actions. If your organization requires InvenTree's core stock change permission as well, enable Require core stock permission in the plugin settings. Loan desk users will then also need the normal InvenTree stock change role.
Workflows
Request
- Open the public page at
/plugin/loan/request/(no account required). - Browse categories or search, open a part to see its description and available stock items, and add the items you need.
- Enter your name, email, phone, organisation and optional ID, plus pickup and return dates and the purpose.
- Accept the responsibility statement and sign in the signature box.
- Send the request. The confirmation includes a secret tracking link.
- Approvers receive an in-app notification (and email if enabled).
Allocate stock
Before approval or handout, staff can plan which physical stock items will be used:
- Open the request detail page and select Auto allocate.
- Review the allocated stock sub-rows. Each row links to the stock item and shows its location and quantity.
- Use Allocate on a line to add a specific stock item manually, or Remove to release an allocation.
- Use Clear allocations to start again.
Allocations are plans, not stock movements. They reduce the reported public availability, and checkout revalidates them before moving stock. Non-trackable parts can be allocated partially across stock items; serialized assets are allocated one unit per stock item. The part name links to the native InvenTree part page, and each allocation links to its stock item page.
Approve or reject
Approvers open the Loan Manager console or the request detail page. The detail view shows the requester, contact details, purpose, dates, items, signature and stock allocations. Approve or Reject, optionally adding a decision note. Anonymous requesters receive the decision at the email address they provided, and can follow the request through their tracking link.
Hand out
- Open the Handout tab in the Loan Manager console, or open the request detail page.
- Select Hand out on an approved request.
- Review the request details and have the borrower sign in the signature box.
- Confirm the handout.
- Print the handout receipt or show the loan QR. The receipt QR code opens the request tracking/detail page.
The service selects available stock items, moves or splits the requested quantities to the On Loan location, applies the On Loan status, and records the original location and status. The handout signature is stored on the loan and shown on the requester's tracking page and the printed receipt.
Return
- Open the Loans tab in the Loan Manager console.
- Choose the loan and select Return.
- Adjust return quantities and select the condition.
- Ask the borrower to sign, then confirm.
- Print the return receipt from the loan row or request detail page.
The item is returned to its original location, the original status is restored, and the loan is marked partially returned or returned. The return signature is stored on the loan. The returned stock item remains linked to the loan line for audit history.
Trackable and non-trackable parts
- Non-trackable parts are quantity-tracked. A request can ask for part of a stock item; the plugin splits the item, moves the split quantity to the loan location, and returns it to the original location and status. The returned split remains a separate stock item so the loan line keeps its audit link.
- Trackable/serialized assets are individual stock items with a serial or asset label. The public page lists the available units, and each unit is added as quantity 1. Trackable parts are requested in whole units; serialized items cannot be partially returned.
Renew, lose, and overdue
- Renew extends the due date, up to the configured maximum.
- Lost closes a line and marks the stock item
Lostwithout losing history. - A daily scheduled task sends due-soon and overdue reminders once per period.
Barcode and QR
Loan QR codes contain a JSON payload:
{"inventree_loan": "<loan-uuid>"}
Loan QR codes can still open the return workflow at the desk. Printed request, handout, and return receipts use a separate QR code that links to the request tracking/detail page. Scanning a stock item barcode delegates to InvenTree's registered barcode plugins, so existing labels continue to work.
The scanner accepts:
- USB/keyboard-wedge scanners (type + Enter)
- Manual entry
- Camera scanning in browsers that support
BarcodeDetector
Stock behavior
- On handout, the item is moved to the On Loan location and its status is changed to the custom On Loan status.
StockItem.is_in_stock()becomes false, so the item drops out of available stock calculations and normal sales-order/build/transfer allocation flows.- On return, the original location and status are restored.
- If the custom status is missing,
Quarantinedis used as a safe fallback. - Direct core edits, moves, quantity changes, customer/order assignment, and deletion
of loaned stock items are rejected by
ValidationMixin. - Superusers and direct database/shell access can always override plugin protections.
Plugin settings
| Setting | Default | Purpose |
|---|---|---|
| On Loan location | — | Stock location used while items are out |
| On Loan status name | ON_LOAN |
Internal custom status name |
| Loanable part category | — | Restrict requests to a category tree |
| Request group | — | Restrict signed-in users on the account pages; public requests remain open |
| Default loan duration | 14 days | Default pickup-to-return period |
| Due soon reminder | 2 days | Reminder lead time |
| Overdue reminder interval | 1 day | Repeat interval for overdue notices |
| Max active loans per user | 0 | 0 means unlimited |
| Max items per request | 25 | Request line limit |
| Require approval | on | Requests must be approved before handout |
| Allow walk-in checkout | on | Desk staff can create direct loans |
| Allow renewals / max renewals | on / 1 | Renewal policy |
| Require responsibility acknowledgement | on | Requester agreement checkbox |
| Allow public requests | on | Allow requests without an InvenTree account |
| Require a signature on requests | on | Requester must sign before submitting |
| Require a signature on handout | on | Borrower must sign when items are issued |
| Require a signature on return | on | Borrower must sign when items are returned |
| Require core stock permission | off | Also check InvenTree stock change permission |
| Lock loaned stock items | on | Block core edits/moves/allocations |
| Hide borrower details from requesters | on | Privacy for scanned items |
| Enable email | off | Send emails in addition to in-app notifications |
| Email from address | — | Optional sender override |
| Loan QR prefix | LOAN: |
Accepted prefix before QR token |
| Catalog page size | 20 | Search result limit |
Development
python -m venv .venv
.venv\Scripts\activate
pip install -e ".[dev]"
Run the plugin tests inside an InvenTree environment:
python manage.py test inventree_loan
or with pytest-django:
python manage.py test inventree_loan
The tests expect the plugin app to be enabled, as InvenTree's test runner enables installed plugins. Tests cover role hierarchy, request visibility, approval permissions, automatic/manual allocation, public availability limits, serialized stock rules, checkout, partial returns, and status restoration.
Packaging
python -m build
The built wheel includes templates, static assets, migrations, and the
inventree_plugins entry point.
Limitations and notes
- The plugin targets InvenTree 1.6–1.7. Test against a new major series before
widening
MAX_VERSION. - Plugin roles are separate from InvenTree groups by design; see the optional core stock permission setting.
- The custom On Loan status must exist before handout. The setup page and management command handle this.
- Returned stock items are not automatically merged into their parent item
(
merge=False), which preserves the loan history link. Staff can merge stock manually if desired. - Camera scanning depends on browser support; USB scanners and manual entry always work.
- The public catalogue intentionally exposes part names, descriptions, stock locations and available quantities. It does not expose pricing, suppliers, borrower details, or other users.
- Loan history is append-only in the UI. Use the Django admin only for emergency maintenance.
Metadata
Release files for inventree-loan 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| inventree_loan-0.2.1.tar.gz | 134.8 kB | Without provenance | Details for inventree_loan-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| inventree_loan-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for inventree_loan-0.2.1-py3-none-any.whl |
Total release size: 291.4 kB
Release files / inventree_loan-0.2.1.tar.gz
| Download URL | inventree_loan-0.2.1.tar.gz |
|---|---|
| Size | 134.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d494737a7a89da6f129fd00070d5dde486053865fe340ae29b311c79190cf451
|
|
BLAKE2b-256 checksum How to use checksums |
044d033e87b886ea5f4f32219500d683442a91afa8549d357abcd52c60135ce1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / inventree_loan-0.2.1-py3-none-any.whl
| Download URL | inventree_loan-0.2.1-py3-none-any.whl |
|---|---|
| Size | 156.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7b600649ebf18caa58a6793472cc25f627ec53c9c8a459e398a039ba9789404
|
|
BLAKE2b-256 checksum How to use checksums |
ffaa050b24a1669e50592d78ee1d6f03d8709d4e629e9ee3645fbd76f4308226
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for inventree-loan 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.