Repository navigation
Conversation
|
@copilot fix issues in ci |
…copilot/feature-fully-covered-implementation
…copilot/feature-fully-covered-implementation
…copilot/feature-fully-covered-implementation
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Warning Review limit reached
Next review available in: 22 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…copilot/feature-fully-covered-implementation
…copilot/feature-fully-covered-implementation
* Unable to install plugins through web UI using custom registry and/or Python wheel files. Fixes inventree#11460 * use more fitting variable name * add typing * clean up logic flow - make easier to understand * make check easier to understand * reduce complexity * ensure user is tested * add more tests * add user validation * move test * disable uninstall in test * Update test_api.py * style fix * fix typing * check if pip exsists * fix gate * fix typo * reference pip instead * make test more tolerant * revert permission check change * remove new test --------- Co-authored-by: Oliver <[email protected]>
) * chore(deps): bump the dependencies group with 7 updates Bumps the dependencies group with 7 updates: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `7.0.0` | `7.0.1` | | [actions/setup-python](https://github.com/actions/setup-python) | `6.3.0` | `7.0.0` | | [j178/prek-action](https://github.com/j178/prek-action) | `2.0.5` | `2.0.6` | | [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) | `0.5.7` | `0.6.0` | | [actions/attest](https://github.com/actions/attest) | `4.1.1` | `4.2.0` | | [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) | `4.37.0` | `4.37.1` | | [crowdin/github-action](https://github.com/crowdin/github-action) | `2.16.3` | `2.16.4` | Updates `actions/checkout` from 7.0.0 to 7.0.1 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@9c091bb...3d3c42e) Updates `actions/setup-python` from 6.3.0 to 7.0.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](actions/setup-python@ece7cb0...5fda3b9) Updates `j178/prek-action` from 2.0.5 to 2.0.6 - [Release notes](https://github.com/j178/prek-action/releases) - [Commits](j178/prek-action@e98a699...5337cb9) Updates `zizmorcore/zizmor-action` from 0.5.7 to 0.6.0 - [Release notes](https://github.com/zizmorcore/zizmor-action/releases) - [Commits](zizmorcore/zizmor-action@192e21d...6599ee8) Updates `actions/attest` from 4.1.1 to 4.2.0 - [Release notes](https://github.com/actions/attest/releases) - [Changelog](https://github.com/actions/attest/blob/main/RELEASE.md) - [Commits](actions/attest@a1948c3...f7c74d2) Updates `github/codeql-action/upload-sarif` from 4.37.0 to 4.37.1 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@99df26d...7188fc3) Updates `crowdin/github-action` from 2.16.3 to 2.16.4 - [Release notes](https://github.com/crowdin/github-action/releases) - [Commits](crowdin/github-action@52aa776...e0c8f73) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: actions/setup-python dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: dependencies - dependency-name: j178/prek-action dependency-version: 2.0.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: zizmorcore/zizmor-action dependency-version: 0.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: actions/attest dependency-version: 4.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: github/codeql-action/upload-sarif dependency-version: 4.37.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: crowdin/github-action dependency-version: 2.16.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies ... Signed-off-by: dependabot[bot] <[email protected]> * fix pin --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Matthias Mair <[email protected]>
…entree#12466) Bumps [postcss](https://github.com/postcss/postcss) from 8.5.15 to 8.5.23. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](postcss/postcss@8.5.15...8.5.23) --- updated-dependencies: - dependency-name: postcss dependency-version: 8.5.23 dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Matthias Mair <[email protected]>
…pdates (inventree#12485) Bumps the dependencies group with 14 updates in the /src/frontend directory: | Package | From | To | | --- | --- | --- | | [@fortawesome/fontawesome-svg-core](https://github.com/FortAwesome/Font-Awesome) | `7.3.0` | `7.3.1` | | [@fortawesome/free-regular-svg-icons](https://github.com/FortAwesome/Font-Awesome) | `7.3.0` | `7.3.1` | | [@fortawesome/free-solid-svg-icons](https://github.com/FortAwesome/Font-Awesome) | `7.3.0` | `7.3.1` | | [@fortawesome/react-fontawesome](https://github.com/FortAwesome/react-fontawesome) | `3.4.0` | `3.5.0` | | [@sentry/react](https://github.com/getsentry/sentry-javascript) | `10.65.0` | `10.67.0` | | [@tabler/icons-react](https://github.com/tabler/tabler-icons/tree/HEAD/packages/icons-react) | `3.44.0` | `3.45.0` | | [@tanstack/react-query](https://github.com/TanStack/query/tree/HEAD/packages/react-query) | `5.101.2` | `5.101.3` | | [mantine-contextmenu](https://github.com/icflorescu/mantine-contextmenu) | `9.3.1` | `9.4.0` | | [mantine-datatable](https://github.com/icflorescu/mantine-datatable) | `9.3.1` | `9.4.0` | | [react-hook-form](https://github.com/react-hook-form/react-hook-form) | `7.81.0` | `7.82.0` | | [recharts](https://github.com/recharts/recharts) | `3.9.2` | `3.10.0` | | [styled-components](https://github.com/styled-components/styled-components) | `6.4.3` | `6.4.4` | | [undici](https://github.com/nodejs/undici) | `8.7.0` | `8.8.0` | | [@vanilla-extract/vite-plugin](https://github.com/vanilla-extract-css/vanilla-extract/tree/HEAD/packages/vite-plugin) | `5.2.4` | `5.2.5` | Updates `@fortawesome/fontawesome-svg-core` from 7.3.0 to 7.3.1 - [Release notes](https://github.com/FortAwesome/Font-Awesome/releases) - [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/7.x/CHANGELOG.md) - [Commits](FortAwesome/Font-Awesome@7.3.0...7.3.1) Updates `@fortawesome/free-regular-svg-icons` from 7.3.0 to 7.3.1 - [Release notes](https://github.com/FortAwesome/Font-Awesome/releases) - [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/7.x/CHANGELOG.md) - [Commits](FortAwesome/Font-Awesome@7.3.0...7.3.1) Updates `@fortawesome/free-solid-svg-icons` from 7.3.0 to 7.3.1 - [Release notes](https://github.com/FortAwesome/Font-Awesome/releases) - [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/7.x/CHANGELOG.md) - [Commits](FortAwesome/Font-Awesome@7.3.0...7.3.1) Updates `@fortawesome/react-fontawesome` from 3.4.0 to 3.5.0 - [Release notes](https://github.com/FortAwesome/react-fontawesome/releases) - [Changelog](https://github.com/FortAwesome/react-fontawesome/blob/main/CHANGELOG.md) - [Commits](FortAwesome/react-fontawesome@v3.4.0...v3.5.0) Updates `@sentry/react` from 10.65.0 to 10.67.0 - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md) - [Commits](getsentry/sentry-javascript@10.65.0...10.67.0) Updates `@tabler/icons-react` from 3.44.0 to 3.45.0 - [Release notes](https://github.com/tabler/tabler-icons/releases) - [Commits](https://github.com/tabler/tabler-icons/commits/v3.45.0/packages/icons-react) Updates `@tanstack/react-query` from 5.101.2 to 5.101.3 - [Release notes](https://github.com/TanStack/query/releases) - [Changelog](https://github.com/TanStack/query/blob/main/packages/react-query/CHANGELOG.md) - [Commits](https://github.com/TanStack/query/commits/@tanstack/[email protected]/packages/react-query) Updates `mantine-contextmenu` from 9.3.1 to 9.4.0 - [Changelog](https://github.com/icflorescu/mantine-contextmenu/blob/main/CHANGELOG.md) - [Commits](https://github.com/icflorescu/mantine-contextmenu/commits) Updates `mantine-datatable` from 9.3.1 to 9.4.0 - [Changelog](https://github.com/icflorescu/mantine-datatable/blob/main/CHANGELOG.md) - [Commits](https://github.com/icflorescu/mantine-datatable/commits) Updates `react-hook-form` from 7.81.0 to 7.82.0 - [Release notes](https://github.com/react-hook-form/react-hook-form/releases) - [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md) - [Commits](react-hook-form/react-hook-form@v7.81.0...v7.82.0) Updates `recharts` from 3.9.2 to 3.10.0 - [Release notes](https://github.com/recharts/recharts/releases) - [Changelog](https://github.com/recharts/recharts/blob/main/CHANGELOG.md) - [Commits](recharts/recharts@v3.9.2...v3.10.0) Updates `styled-components` from 6.4.3 to 6.4.4 - [Release notes](https://github.com/styled-components/styled-components/releases) - [Commits](https://github.com/styled-components/styled-components/compare/[email protected]@6.4.4) Updates `undici` from 8.7.0 to 8.8.0 - [Release notes](https://github.com/nodejs/undici/releases) - [Commits](nodejs/undici@v8.7.0...v8.8.0) Updates `@vanilla-extract/vite-plugin` from 5.2.4 to 5.2.5 - [Release notes](https://github.com/vanilla-extract-css/vanilla-extract/releases) - [Changelog](https://github.com/vanilla-extract-css/vanilla-extract/blob/master/packages/vite-plugin/CHANGELOG.md) - [Commits](https://github.com/vanilla-extract-css/vanilla-extract/commits/@vanilla-extract/[email protected]/packages/vite-plugin) --- updated-dependencies: - dependency-name: "@fortawesome/fontawesome-svg-core" dependency-version: 7.3.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: "@fortawesome/free-regular-svg-icons" dependency-version: 7.3.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: "@fortawesome/free-solid-svg-icons" dependency-version: 7.3.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: "@fortawesome/react-fontawesome" dependency-version: 3.5.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: "@sentry/react" dependency-version: 10.67.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: "@tabler/icons-react" dependency-version: 3.45.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: "@tanstack/react-query" dependency-version: 5.101.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: mantine-contextmenu dependency-version: 9.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: mantine-datatable dependency-version: 9.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: react-hook-form dependency-version: 7.82.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: recharts dependency-version: 3.10.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: styled-components dependency-version: 6.4.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: undici dependency-version: 8.8.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: "@vanilla-extract/vite-plugin" dependency-version: 5.2.5 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: dependencies ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fix concurrency issues for allocation * Remove duplicate atomic call * Reduce query count
* Unique constraint for serial numbers * Revert unrelated changes * Updated tests
* Remove serial number restriction when creating build outputs * Updated docs * additional docs
* Filtering for report snippets * Bump API version
- Only update 'last_seen' field
- Ensure that validated data is a dict shape
- Prevent multiple instances of scheduled tasks from plugins
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…copilot/feature-fully-covered-implementation
closes inventree#12314 based on #721
* full fsm implementation closes #12314 based on matmair#721 * update assertations * refactor to reduce duplication * move for cleaner diff * more moving stuff around * fix assingment * remove skip * merge test classes * re-enable transition plugin tests * fix docstrings * add depreciation warning * fix type * nitpicks * small cleanup * ensure we alwas pass a str * add backport * fix marker position * full fsm implementation closes #12314 based on matmair#721 * update assertations * refactor to reduce duplication * move for cleaner diff * more moving stuff around * fix assingment * remove skip * merge test classes * re-enable transition plugin tests * fix docstrings * add depreciation warning * fix type * nitpicks * small cleanup * ensure we alwas pass a str * add backport * fix marker position * fix ty issue * ignore this corner case * ensure invalid transitions can raise a nice validation error * compact code * add depreciation mark * make raise_error default (#754) * fix merge * adjust test as this is now not a no-op but a raised error * fix assertations * fix test to not take a broken path * remove unused test statements * converge * add test branch for actually working transition * reduce uneeded code * ignore depreceated methods * fix missing coverage * add prefetch * reduce diff
Replaces InvenTree's hand-rolled FSM mechanism across order and build models with
django-fsm-2, eliminating the repetitive 3-method pattern (can_X+_action_X+X_method) per transition (~200 lines removed).Infrastructure
BaseEnum.__hash__— Python silently sets__hash__ = Nonewhen__eq__is overridden; django-fsm needs enum members hashable as dict keys.InvenTreeCustomStatusModelFieldnow extendsFSMFieldMixinalongsidePositiveIntegerField.deconstruct()strips the addedprotectedkwarg so no migration is generated.inventree_transitiondecorator (generic/states/transition.py) wraps@transitionwith@transaction.atomicand auto-save(). CatchesTransitionNotAllowed→ returnsFalseto preserve backward-compatible call sites that check the return value.pre_transitionsignal (_plugin_pre_transition_handler), replacing explicithandle_transition()calls.ValidationErrorraised by plugins propagates normally; it is not swallowed.Model refactoring
Each transition collapses to a single decorated method:
Refactored: all 4
PurchaseOrder, 5SalesOrder, 4ReturnOrder, 4TransferOrder, and 4Buildtransitions.SalesOrder.ship_order/complete_orderuseRETURN_VALUEfor the dynamic SHIPPED/COMPLETE target based on theSALESORDER_SHIP_COMPLETEsetting.Source state notes
SalesOrder.ship_orderandcomplete_orderincludePENDINGas a valid source — the original code had no source restriction and existing callers invoke these directly on pending orders, gated by thecan_complete()business logic check.Build.complete_buildincludesPENDINGandON_HOLDas valid sources for the same reason.handle_transition()is retained for backward compatibility with any direct callers.Tests
New
InvenTreeTransitionTestsclass covers:_django_fsmmetadata presence,can_proceed()accuracy, full PENDING→PLACED→ON_HOLD→PLACED→CANCELLED lifecycle, invalid-transition returnsFalse(backward compat), andcan_issueproperty delegation.