2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-02-06 13:25:53 +00:00
Commit Graph

1092 Commits

Author SHA1 Message Date
Matthias Mair
620e69be4d feat(backend): extend schema intro (#10628)
* small refactor

* add inventree vendor extension

* bump api version

* Add control over schema to settings

* add more details

* disable config as requested

* adjust 3.14 diff

* cleanup diff

* add docs on the new feature

* revert bumping of api version - there is no cahnge by default
2026-01-29 16:31:58 +11:00
Matthias Mair
ec10c1ef1b fix deps (#11219) 2026-01-29 10:17:36 +11:00
Matthias Mair
c7a0da1a68 feat: matrix testing for python 3.14 (#10904)
* feat: matrix testing

* remove unneeded args

* remove hashes for now

* remove require-hashes for now

* try manually fixing cffi for now

* remove wrong cache syntax

* remove cache for now

* move to 3.14?

* make version specific install req

* re-add hashes

* Revert "remove require-hashes for now"

This reverts commit 7a7e12130a.

* also compile requirements-dev

* move more install commands

* fix generation setting

* more logging

* remove cache exception

* remove cffi fix

* remove hash inforcement for now

* remove dev for now

* default to 3.14 to val

* Revert "default to 3.14 to val"

This reverts commit 7a28e46604.

* fix constraints

* remove pin requirement from plugins.txt

* do not use uv for now

* do not use uv for now

* fix test file format

* revert small change

* use 3.14 for benchmarks

* keep tests on 3.11

* use invoke for install

* try 3.14 for performance testing again

* prolong time for slower CI on 3.14

* adjust dep versions

* Keep performance ci on 3.12

Updated the Python version in the QC checks workflow.
2026-01-28 13:17:51 +11:00
Jacob Felknor
df90934f0c Stock Tracking - Add Old Status to Deltas (#11179)
* match custom status tracking entry in edit

* add old_status to stockitemtracking

* test old_status tracking

* use vars for readability

* split custom status test

* move custom status from fixture to setup

* add old status to tracking table

* fallback to logical status if custom removed

* avoid shared deltas reference in loop

* track old status in stock add/remove/count/transfer

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2026-01-27 18:44:28 +11:00
dependabot[bot]
67c67a1650 chore(deps): bump pypdf from 6.6.0 to 6.6.2 in /src/backend (#11207)
* chore(deps): bump pypdf from 6.6.0 to 6.6.2 in /src/backend

Bumps [pypdf](https://github.com/py-pdf/pypdf) from 6.6.0 to 6.6.2.
- [Release notes](https://github.com/py-pdf/pypdf/releases)
- [Changelog](https://github.com/py-pdf/pypdf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/py-pdf/pypdf/compare/6.6.0...6.6.2)

---
updated-dependencies:
- dependency-name: pypdf
  dependency-version: 6.6.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix style

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
2026-01-27 12:45:40 +11:00
dependabot[bot]
89ff4be082 chore(deps): bump wheel from 0.45.1 to 0.46.2 in /src/backend (#11197)
* chore(deps): bump wheel from 0.45.1 to 0.46.2 in /src/backend

Bumps [wheel](https://github.com/pypa/wheel) from 0.45.1 to 0.46.2.
- [Release notes](https://github.com/pypa/wheel/releases)
- [Changelog](https://github.com/pypa/wheel/blob/main/docs/news.rst)
- [Commits](https://github.com/pypa/wheel/compare/0.45.1...0.46.2)

---
updated-dependencies:
- dependency-name: wheel
  dependency-version: 0.46.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix style

* bump wheel verywhere

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
2026-01-27 11:41:01 +11:00
dependabot[bot]
4e5921277a chore(deps): bump the dependencies group across 1 directory with 4 updates (#11149)
* chore(deps): bump the dependencies group across 1 directory with 4 updates

Bumps the dependencies group with 4 updates in the /src/backend directory: [django-dbbackup](https://github.com/Archmonger/django-dbbackup), [django-oauth-toolkit](https://github.com/django-oauth/django-oauth-toolkit), [dulwich](https://github.com/dulwich/dulwich) and [sentry-sdk](https://github.com/getsentry/sentry-python).


Updates `django-dbbackup` from 5.1.0 to 5.1.1
- [Release notes](https://github.com/Archmonger/django-dbbackup/releases)
- [Changelog](https://github.com/Archmonger/django-dbbackup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Archmonger/django-dbbackup/compare/5.1.0...5.1.1)

Updates `django-oauth-toolkit` from 3.1.0 to 3.2.0
- [Release notes](https://github.com/django-oauth/django-oauth-toolkit/releases)
- [Changelog](https://github.com/django-oauth/django-oauth-toolkit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/django-oauth/django-oauth-toolkit/compare/3.1.0...3.2.0)

Updates `dulwich` from 0.25.0 to 0.25.1
- [Release notes](https://github.com/dulwich/dulwich/releases)
- [Changelog](https://github.com/jelmer/dulwich/blob/main/NEWS)
- [Commits](https://github.com/dulwich/dulwich/compare/dulwich-0.25.0...dulwich-0.25.1)

Updates `sentry-sdk` from 2.48.0 to 2.49.0
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.48.0...2.49.0)

---
updated-dependencies:
- dependency-name: django-dbbackup
  dependency-version: 5.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
- dependency-name: django-oauth-toolkit
  dependency-version: 3.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
- dependency-name: dulwich
  dependency-version: 0.25.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
- dependency-name: sentry-sdk
  dependency-version: 2.49.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix style

* add new model for new oauth toolkit variant

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
2026-01-27 11:40:31 +11:00
Matthias Mair
060e917fc9 fix (backend): finer grained registration control for Single Sign On (#11190)
* finer grained registration control for Single Sign On
Fixes #11162

* fix for python 3.11
2026-01-22 23:36:34 +11:00
github-actions[bot]
7f3c86163d New Crowdin translations by GitHub Action (#11158)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-22 19:06:17 +11:00
Oliver
3343514631 Improved handling for non-git-repo in docker mode (#11187)
- Handle error condition caused by loading order of operations
2026-01-22 12:30:08 +11:00
Oliver
64acdd6ccf [bug] Fix "can_build" quantity (#11185)
- Ignore virtual parts when considering "can_build" quantity
- Closes https://github.com/inventree/InvenTree/issues/11182
2026-01-22 12:14:35 +11:00
Oliver
00c36e9366 Stock status fix (#11183)
* Fill in default value

* Ensure status values are converted to integer in set_status

* Updated unit testing

* Additional unit testing
2026-01-22 11:46:36 +11:00
Oliver
e025180242 Sort by ipn (#11177)
* Enable sorting by IPN in BOM table

* Ordering by IPN in build line table

* Bump API version
2026-01-21 17:01:24 +11:00
Philipp Fruck
2b091832d0 fix(auth): Use correct data for SSO group sync (#11164)
https://docs.allauth.org/en/latest/release-notes/recent.html#id18
Since django-allauth 65.11.0 (InvenTree v1.1.X), the extra_data
is divided into separate userinfo and id_token objects
2026-01-20 07:49:48 +11:00
Oliver
56719655b3 Fix typos identified by translators (#11157)
* Fix typos identified by translators

* bump api version

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2026-01-18 10:45:46 +11:00
Oliver
75121c068e Enable export of supplier price break data (#11153)
* Enable export of supplier price break data

* Bump API version
2026-01-17 23:23:15 +11:00
github-actions[bot]
4ad241ce47 New Crowdin translations by GitHub Action (#11121)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-17 19:15:05 +11:00
Matthias Mair
9fa40ae572 fix: MFA enforce flows / interactions (#10796)
* Add a explicit confirm when MFA Enforcing is turned on

https://github.com/inventree/InvenTree/issues/10754

* add error boundary for the case of a login enforcement

* ensure registration setup is redirected to

* fix auth url

* adjust error boundary

* update test

* be more specific in enforcement flow

* ensure we log the admin also out immidiatly after removing all mfa

* small cleanup

* sml chg

* fix execution order issues

* clean up args

* cleanup

* add test for mfa change logout

* fix IP in test

* add option to require an explicit confirm

* adapt ui to ask before patching

* bump API version
2026-01-16 09:33:10 +11:00
Matthias Mair
07e1a72261 feat(backend): enable reseting mfa via username from the cli (#11133)
* feat(backend): enable reseting mfa via username

* fix tests

* extend testing saveguards to username cli
2026-01-14 22:04:21 +11:00
dependabot[bot]
9c1b03eb71 chore(deps): bump virtualenv from 20.36.0 to 20.36.1 in /src/backend (#11128)
* chore(deps): bump virtualenv from 20.36.0 to 20.36.1 in /src/backend

Bumps [virtualenv](https://github.com/pypa/virtualenv) from 20.36.0 to 20.36.1.
- [Release notes](https://github.com/pypa/virtualenv/releases)
- [Changelog](https://github.com/pypa/virtualenv/blob/main/docs/changelog.rst)
- [Commits](https://github.com/pypa/virtualenv/compare/20.36.0...20.36.1)

---
updated-dependencies:
- dependency-name: virtualenv
  dependency-version: 20.36.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix style

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
2026-01-14 22:03:36 +11:00
Matthias Mair
22d6f7d191 chore(ci): Re-enable codspeed runner (#11120)
* re-enable codspeed runner

* dummy change

* add readme entry

* do not run codspeed in forks

* set node version

* also set up node

* fix link
2026-01-14 22:03:23 +11:00
dependabot[bot]
8715151e4f chore(deps): bump filelock from 3.20.2 to 3.20.3 in /src/backend (#11129)
* chore(deps): bump filelock from 3.20.2 to 3.20.3 in /src/backend

Bumps [filelock](https://github.com/tox-dev/py-filelock) from 3.20.2 to 3.20.3.
- [Release notes](https://github.com/tox-dev/py-filelock/releases)
- [Changelog](https://github.com/tox-dev/filelock/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/py-filelock/compare/3.20.2...3.20.3)

---
updated-dependencies:
- dependency-name: filelock
  dependency-version: 3.20.3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix style

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
2026-01-14 15:15:45 +11:00
Oliver
372b19e5cd [bug] build output stock status (#11126)
- Ensure custom status is correctly set when completing build output
- Closes https://github.com/inventree/InvenTree/issues/11119
2026-01-13 17:48:31 +11:00
dependabot[bot]
370fc470e4 chore(deps): bump pypdf from 6.5.0 to 6.6.0 in /src/backend (#11116)
* chore(deps): bump pypdf from 6.5.0 to 6.6.0 in /src/backend

Bumps [pypdf](https://github.com/py-pdf/pypdf) from 6.5.0 to 6.6.0.
- [Release notes](https://github.com/py-pdf/pypdf/releases)
- [Changelog](https://github.com/py-pdf/pypdf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/py-pdf/pypdf/compare/6.5.0...6.6.0)

---
updated-dependencies:
- dependency-name: pypdf
  dependency-version: 6.6.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix style

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
2026-01-13 13:03:26 +11:00
github-actions[bot]
0134664e96 New Crowdin translations by GitHub Action (#11089)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-12 09:58:46 +11:00
Matthias Mair
e1b5fbd38d feat(backend): better for logging to detect issues with static files discovery (#11067)
* reduce noise in docker

* refactor path infos

* add more info during local frontend build

* add frontend info during release build

* ignore "special" import

* change var name
2026-01-10 12:53:55 +11:00
Joe Rogers
a74d809fc2 Fix Schema Nullables (#11092)
* Add missing nullable annotations

* bump API version
2026-01-10 12:44:22 +11:00
Oliver
70fcaa7808 BuildItem quantity fix (#11108)
* Refactor clean check for BuildItem

* Don't raise an error when saving a BuildItem

* Fix order of operations

* remove debug statements
2026-01-09 18:45:44 +11:00
Oliver
02a95ffba8 Tweak for auto allocation (#11106)
- Ensure only stock for "active" parts is considered
- Cleaner logic
2026-01-09 14:53:50 +11:00
Matthias Mair
26f105fe88 feat(backend): Add dedicated health endpoint (#11104)
* feat(backend): Add dedicated health endpoint

* bump api version

* add test for new endpoint

* fix check
2026-01-09 14:06:51 +11:00
Oliver
be711464ff Bug fix for stock entry calculation (#11103)
- Additional unit testing
2026-01-09 11:01:03 +11:00
Matthias Mair
eba1cdcbd4 backend: bump deps (#11097)
* bump backend deps

* lower ty again
2026-01-09 09:15:21 +11:00
Oliver
4709dc8a9a [API] Search improvements (#11094)
* Improve prefetching

* Cache user groups for permission  check

* Use a GET request to execute search

- Prevent forced prefetch
- Reduce execution time significantly

* Fix group caching

* Improve StockItemSerializer

- Select related for pricing_data rather than prefetch

* Add benchmarking for search endpoint

* Adjust prefetch

* Ensure no errors returned

* Fix prefetch

* Fix more prefetch issues

* Remove debug print

* Fix for performance testing

* Data is already returned as dict

* Test fix

* Extract model types better
2026-01-08 18:06:23 +11:00
Matthias Mair
2457197446 Bump tooling (#11096)
* Matmair/issue10740 (#497)

* reduce noise in docker

* refactor path infos

* add more info during local frontend build

* add frontend info during release build

* Revert "Matmair/issue10740 (#497)" (#498)

This reverts commit 415c52813b.

* bum pre-commit and update to new formatting rule

* fix style
2026-01-08 10:01:23 +11:00
Oliver
114d07343a Refactor "is_top_level" check (#11093)
- Request attribute only exists for top-level serializer
- Simplified code
2026-01-07 21:26:47 +11:00
Oliver
b478254e98 Location parameters (#11084)
* Add parameter support for StockLocation model

* Serialize parameters for stock location

* Frontend support

* Bump API version

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2026-01-07 12:57:20 +11:00
github-actions[bot]
20c381f862 New Crowdin translations by GitHub Action (#10978)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-07 10:37:41 +11:00
Matthias Mair
5b290f44c0 refactor(backend): reduce API surface by unifying metadata endpoints (#11035)
* replace individual metadata endpoints with a generic endpoint an a lot of permanent redirects

* remove more names

* reduce duplication more

* remove now unneeded tests

* update remaining tests to use urls

* bump api

* follow redirects in tests

* reduce new fncs

* fix redirect setup

* fix test

* update to fix schema collissions

* fix permission check

* simplify and fix lookup

* clone fork for now

* add changelog entry

* update api version date

* remove temporary change to python lib

* update docs
2026-01-07 07:13:25 +11:00
Matthias Mair
0a685c09de refactor(backend): use walltime for performance testing (#11081)
* Matmair/issue10740 (#497)

* reduce noise in docker

* refactor path infos

* add more info during local frontend build

* add frontend info during release build

* Revert "Matmair/issue10740 (#497)" (#498)

This reverts commit 415c52813b.

* use walltime

* switch measure mode

* dummy change

* dummy change

* ensure npm works

* pin needed version

* split out performance test to also use walltime

* roll back split, is too slow

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2026-01-07 07:05:12 +11:00
Oliver
31a46e25a4 Do not redirect for /plugin/ requests (#11085)
- Instead, return a 401 error code
2026-01-06 15:43:23 +11:00
Matthias Mair
75d6cbf729 feat (backend): Add more performance tests (#11080)
* Matmair/issue10740 (#497)

* reduce noise in docker

* refactor path infos

* add more info during local frontend build

* add frontend info during release build

* Revert "Matmair/issue10740 (#497)" (#498)

This reverts commit 415c52813b.

* add more performance tests (dummy)

* dummy change

* disable debug for a more realistic test

* revert debug change

* add "real" tests

* fix style

* specify backend for type check

* add setup prep step

* fix uninstall command

* fix install?

* fix instanciation

* fix test

* fix format

* disable tests

* add auth test

* fix test
2026-01-06 14:41:01 +11:00
dependabot[bot]
025f6ffba1 chore(deps): bump the dependencies group across 2 directories with 9 updates (#11075)
* chore(deps): bump the dependencies group across 2 directories with 9 updates

Bumps the dependencies group with 1 update in the /docs directory: [mkdocs-material](https://github.com/squidfunk/mkdocs-material).
Bumps the dependencies group with 7 updates in the /src/backend directory:

| Package | From | To |
| --- | --- | --- |
| [django](https://github.com/django/django) | `5.2.9` | `6.0` |
| [django-dbbackup](https://github.com/Archmonger/django-dbbackup) | `5.0.1` | `5.1.0` |
| [docutils](https://github.com/rtfd/recommonmark) | `0.22.3` | `0.22.4` |
| [dulwich](https://github.com/dulwich/dulwich) | `0.24.10` | `0.25.0` |
| [pypdf](https://github.com/py-pdf/pypdf) | `6.4.1` | `6.5.0` |
| [sentry-sdk](https://github.com/getsentry/sentry-python) | `2.47.0` | `2.48.0` |
| [pre-commit](https://github.com/pre-commit/pre-commit) | `4.5.0` | `4.5.1` |



Updates `mkdocs-material` from 9.7.0 to 9.7.1
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.7.0...9.7.1)

Updates `django` from 5.2.9 to 6.0
- [Commits](https://github.com/django/django/compare/5.2.9...6.0)

Updates `django-dbbackup` from 5.0.1 to 5.1.0
- [Release notes](https://github.com/Archmonger/django-dbbackup/releases)
- [Changelog](https://github.com/Archmonger/django-dbbackup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Archmonger/django-dbbackup/compare/5.0.1...5.1.0)

Updates `docutils` from 0.22.3 to 0.22.4
- [Changelog](https://github.com/readthedocs/recommonmark/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rtfd/recommonmark/commits)

Updates `dulwich` from 0.24.10 to 0.25.0
- [Release notes](https://github.com/dulwich/dulwich/releases)
- [Changelog](https://github.com/jelmer/dulwich/blob/master/NEWS)
- [Commits](https://github.com/dulwich/dulwich/compare/dulwich-0.24.10...dulwich-0.25.0)

Updates `pypdf` from 6.4.1 to 6.5.0
- [Release notes](https://github.com/py-pdf/pypdf/releases)
- [Changelog](https://github.com/py-pdf/pypdf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/py-pdf/pypdf/compare/6.4.1...6.5.0)

Updates `sentry-sdk` from 2.47.0 to 2.48.0
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.47.0...2.48.0)

Updates `setuptools` from 80.9.0 to 
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/commits)

Updates `pre-commit` from 4.5.0 to 4.5.1
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pre-commit/pre-commit/compare/v4.5.0...v4.5.1)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-version: 9.7.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
- dependency-name: django
  dependency-version: '6.0'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: dependencies
- dependency-name: django-dbbackup
  dependency-version: 5.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
- dependency-name: docutils
  dependency-version: 0.22.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
- dependency-name: dulwich
  dependency-version: 0.25.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
- dependency-name: pypdf
  dependency-version: 6.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
- dependency-name: sentry-sdk
  dependency-version: 2.48.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
- dependency-name: setuptools
  dependency-version: 
  dependency-type: direct:production
  dependency-group: dependencies
- dependency-name: pre-commit
  dependency-version: 4.5.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix style

* lower back - this is intentional

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
2026-01-05 13:23:42 +11:00
Oliver
c1d7f2a300 [bug] Trim stock allocation (#11060)
* Trim stock allocation

- Handle condition where allocated quantity exceeds available stock
- Prevent silent failure of build completion

* Fix display in buildallocatedstock table

* Consolidate table columns

* Fetch substitutes for BOM table
2025-12-23 12:16:51 +11:00
Oliver
9d2ac521ef Data export fix (#11055)
* Only look at query_params for top-level serializers

- Nested serializers should *not* look at query params

* Prevent all fields when exporting data

* Add unit test for large dataset export

* Fix code

* Pass through via context rather than primary kwarg

* Fix for file download

* Ensure request is passed through to the serializer

* ensure query params are passed through when exporting data

* Fix code comment

* Fix for unit test helper func

* Increase max export time
2025-12-23 08:46:41 +11:00
dependabot[bot]
947a3e26a0 chore(deps): bump the dependencies group across 1 directory with 4 updates (#11051)
* chore(deps): bump the dependencies group across 1 directory with 4 updates

Bumps the dependencies group with 3 updates in the /src/backend directory: [django](https://github.com/django/django), [django-markdownify](https://github.com/erwinmatijsen/django-markdownify) and [pypdf](https://github.com/py-pdf/pypdf).


Updates `django` from 5.2.9 to 6.0
- [Commits](https://github.com/django/django/compare/5.2.9...6.0)

Updates `setuptools` from 80.9.0 to 
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/commits)

Updates `django-markdownify` from 0.9.5 to 0.9.6
- [Commits](https://github.com/erwinmatijsen/django-markdownify/compare/0.9.5...0.9.6)

Updates `pypdf` from 6.4.0 to 6.4.1
- [Release notes](https://github.com/py-pdf/pypdf/releases)
- [Changelog](https://github.com/py-pdf/pypdf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/py-pdf/pypdf/compare/6.4.0...6.4.1)

---
updated-dependencies:
- dependency-name: django
  dependency-version: '6.0'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: dependencies
- dependency-name: setuptools
  dependency-version: 
  dependency-type: direct:production
  dependency-group: dependencies
- dependency-name: django-markdownify
  dependency-version: 0.9.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
- dependency-name: pypdf
  dependency-version: 6.4.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix style

* lower django

* Update Django version constraint to <6.0

* fix style

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
2025-12-21 22:31:17 +11:00
Mitch Davis
27c4c5b467 Put the admin user info in one place (#11047) 2025-12-21 11:52:37 +11:00
Matthias Mair
79c43be4f1 feat(backend): add performance tests (#11017)
* feat(backend): add performance test

ref #11002

* feat(backend): add performance test (#486)

* chore(deps): bump the dependencies group across 1 directory with 2 updates (#11003)

* chore(deps): bump the dependencies group across 1 directory with 2 updates

Bumps the dependencies group with 2 updates in the /src/backend directory: [django-q2](https://github.com/GDay/django-q2) and [sentry-sdk](https://github.com/getsentry/sentry-python).


Updates `django-q2` from 1.8.0 to 1.9.0
- [Release notes](https://github.com/GDay/django-q2/releases)
- [Changelog](https://github.com/django-q2/django-q2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/GDay/django-q2/compare/v1.8.0...v1.9.0)

Updates `sentry-sdk` from 2.46.0 to 2.47.0
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.46.0...2.47.0)

---
updated-dependencies:
- dependency-name: django-q2
  dependency-version: 1.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
- dependency-name: sentry-sdk
  dependency-version: 2.47.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix style

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias Mair <code@mjmair.com>

* Rearrange python package installs in are metal setup  (#11005)

* Reorder pip installation steps in bare metal setup

* Reorder pip installation steps in bare metal setup

* remove unused lines

* Fix docs formatting (#11008)

* Remove prefetch_related from parametric data filter (#11007)

- Not required as we do not process the parameter fields in python

* [refactor] Generic status API (#11009)

* Fix docs formatting

* [refactor] cache custom states

- Generic state API endpoint executed  query for each state type
- We can run a single database query and cache these in memory
- Reduces query time by ~50%

* [refactor] Build list (#11010)

- Prefetch project_code
- Annotate parameter data

* Improve the documentation installation instructions. (#11011)

Co-authored-by: Mitch Davis <mjd@afork.com>

* [refactor] Improve primary_address annotation for Company API (#11006)

* Refactor primary_address annotation

- Remove SerializerMethodField
- Better cache introspection

* Allow address detail to be optional

* Refactor address caching

* Fix primary_address annotation

* Remove "address_count" field

- Pointless annotation which is not used anywhere

* Update API version

* Tweak docs page

* Tweak unit tests

* feat(backend): add performance test

ref #11002

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael <michael@buchmann.ruhr>
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
Co-authored-by: Mitch Davis <mjd+github@afork.com>
Co-authored-by: Mitch Davis <mjd@afork.com>

* add oidc perm

* fix run setup

* add gitignore

* pin action

* enable DB for test

* patch test detection

* move test argument into tasks

* seperate performance testing into own step

* add automigration

* update test

* Increase MAX_QUERY_TIME to 60 seconds

* use newer python for better prerformance / measurement options

* skip plugin install step

* add debug step

* add debug stmt

* make version import safe

* fix command

* more debugging

* move import

* rollback changes

* do full install

* rollback skip_plugins too

* hide version

* new debug try

* add more debug

* try 3.13

* try reinstalling the cffi

* reinstall cffi?

* reset debug

* rollback debug steos

* add initial tests

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael <michael@buchmann.ruhr>
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
Co-authored-by: Mitch Davis <mjd+github@afork.com>
Co-authored-by: Mitch Davis <mjd@afork.com>
2025-12-19 08:45:49 +11:00
Oliver
60ec998d5c [bug] BOM exporter (#11038)
* [bug] BOM exporter

- Ensure sub-items are correctly annotated for multi-level BOM export

* Remove debug statements
2025-12-18 17:50:58 +11:00
Oliver
7b181bb5ae [API] Query improvements (#11034)
* Improve prefetch fields for API

* Cache ContentType queryset for getModelsWithMixin

- Called a LOT of times for an options request
- Store the list in the session cache
- Much faster than redis - and expires after the session is complete

* Skip optional prefetch for options requests

* Custom implementation of DjangoModelPermission

- Cache the queryset against the view
- Prevents multiple hits for OPTIONS request
- Saves > 100ms on /stock/ options request
2025-12-17 20:20:59 +11:00
dependabot[bot]
145f4751c2 chore(deps): bump filelock from 3.20.0 to 3.20.1 in /src/backend (#11032)
* chore(deps): bump filelock from 3.20.0 to 3.20.1 in /src/backend

Bumps [filelock](https://github.com/tox-dev/py-filelock) from 3.20.0 to 3.20.1.
- [Release notes](https://github.com/tox-dev/py-filelock/releases)
- [Changelog](https://github.com/tox-dev/filelock/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/py-filelock/compare/3.20.0...3.20.1)

---
updated-dependencies:
- dependency-name: filelock
  dependency-version: 3.20.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix style

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
2025-12-17 10:34:10 +11:00