ContentTypePermission works out 'view' for safe methods and 'change'
otherwise, but its fallback for models without check_permission()
(e.g. Part, StockItem) still passed a hardcoded 'change'. Reading
metadata via the generic metadata endpoint therefore required 'change'
permission, unlike the model's own detail endpoint, which needs 'view'.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 3744e74671)
* Check for allocated stock on transfer action
- Prevent partial transfer of allocated stock
* Check allocation on more actions: serialize / install
* Additional stock detail badges
* include transfer order allocations
* fix playwright test
(cherry picked from commit de39c1626c)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
Requesting a transfer quantity larger than the stock item quantity moves
the entire item, but the tracking entry recorded the requested quantity.
Clamp the quantity to the item quantity before recording the event.
Fixes#13259
(cherry picked from commit dfc5ca9c04)
Co-authored-by: Quimxi <quimxi6@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
BuildItem.check_allocated_quantity() summed build and sales order
allocations but not transfer order allocations, so stock that was
fully allocated to an open transfer order could be allocated again to
a build order via the API (POST /api/build/item/).
Include transfer_order_allocation_count() in the check, matching
StockItem.allocation_count() and bulk_allocation_count().
Fixes#13286
(cherry picked from commit 3572714f5f)
Co-authored-by: Arjun Kotwal <arjun.kotwal@ontariotechu.net>
The redirect target set by ProtectedRoute travels in react-router state,
which does not survive the full page navigation through the identity
provider. After the SSO round trip users always landed on /home.
Forward the target through the flow as a 'next' query param on the
allauth callback URL instead, and recover it on the /logged-in page.
Falls back to /home when no valid in-app path is present.
(cherry picked from commit b9b46797c2)
Co-authored-by: Alex Martens <alex@thinglab.org>
Co-authored-by: Matthias Mair <code@mjmair.com>
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
Clicking a detail image opened it at Mantine's default modal width
(about 440 px), so a large image was shown no bigger than the preview.
Open the modal at 90vw and cap the image at 85vh so it fits the window.
Fixes#13252
(cherry picked from commit ed0bbc3c75)
Co-authored-by: jbc-af <jbc@auto-fruit.com>
Co-authored-by: jbc-af <jbc@autofruit.com>
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
Apply row-level locking when completing shipment allocation to avoid concurrent update issues
(cherry picked from commit 7787408fff)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
- Handle condition where an API field has the same name as one of the "backup" catch-all fields
(cherry picked from commit c80090b3ce)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
- Fetch appropriate 'tags' detail in the form request
- Additional playwright tests
(cherry picked from commit 3383e865cb)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* provide context in docker startup logs
* reduce unnecessary docker logging
* this is set in one place; can be less complicated
(cherry picked from commit 8f668657b3)
Co-authored-by: Matthias Mair <code@mjmair.com>
- Ensure all token issuance endpoints are explicitly checked for MFA auth
- Additional backend unit tests
- Additional frontend unit tests
(cherry picked from commit 02d6a038bf)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
Metadata API endpoints now observe the user permissions associated with the underlying models
(cherry picked from commit 0cb1852e0d)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* fix basic auth without mfa
* refactor order to use new basic auth class
* remove session auth taht would bybpass mfa (mfa thing fixed in another session)
* allign with other PRs
prep for merge with https://github.com/inventree/InvenTree/pull/13169/
* fix schema generation
* [UI] Launch forms directly from plugin
Provide ability for plugins to dynamically launch modal forms, without specifying the underlying react components.
This allows (for example) a primary action on a detail page to launch a new native API form
* Add CHANGELOG entry
- Improved validation of data import session
- Handle FieldError if incorrect filter field is provided
- Prevent model traversal via import session filtering
- Added regression tests
* Fix error when generating default settings
- Prevent database error on conflicting rows
- Can be caused by concurrent user requests
* ignore conflicts for TipResult