2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-04-15 07:48:51 +00:00
Commit Graph

255 Commits

Author SHA1 Message Date
Oliver
01bb113396 [UI] Adjust "superuser warning" banner (#11696)
* Fix typo

- evelevated -> elevated

* Add playwright test

* Add new control settings
2026-04-10 11:37:37 +10:00
Oliver
9965ebcfa1 Selection lists updates (#11705)
* Add search capability to selection list entry endpoint

* Use API lookup for selection entries

* Add renderer func

* Allow API filtering

* Fetch selectionentry data related to the selected data item

* remove now unneeded entry

* add missing modelinfo

* fix ref

* add api bump

* Provide optional single fetch function to API forms

- Useful if we need to perform a custom API call for initial data

* django-admin support for SelectionList

* Docstring improvements

* Apply 'active' filter

* Tweak api version entry

* Playwright tests

* Tweak docs wording

* Fix incorrect docstring

* Adjust playwright tests

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2026-04-10 09:22:12 +10:00
Oliver
343f0975b6 Export fix (#11693)
* Fix for ManufacturerPartList

- Support data export via API

* Add playwright tests

* Bump API version
2026-04-08 19:16:31 +10:00
Oliver
bb3293ef31 Updates to part revision support (#11670)
* Update revision validation

* Refactor UI display

* Fix for usePartFields

* Rearrange part settings

* Better visuals

* Update docs

* use 'full_name' field

* Update playwright tests

* Adjust unit test

* Fix playwright tests
2026-04-04 00:10:25 +11:00
Oliver
6243aec9b7 Shipment parameters (#11641)
* Add 'parameter' support for SalesOrderShipment model

* Add "parameters" tab for shipment view

* Playwright test

* Update CHANGELOG

* Update API version

* Install gettext

* Try yaml format

* Revert "Try yaml format"

This reverts commit 394a5551c8.

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2026-04-01 10:31:49 +11:00
Oliver
dab4319033 Receive virtual parts (#11627)
* Handle receive of virtual parts

- Update line item quantity
- Do not add any stock

* Add unit test

* Additional unit test

* UI form improvements

* Add playwright test

* Updated playwright tests
2026-03-30 19:10:56 +11:00
Oliver
2c7b2d27f9 Badge fix (#11624)
* Fix "in production" badge

- Use the total scheduled build quantity

* Add "Allocated" badge

* Tweak playwright tests
2026-03-30 08:38:53 +11:00
Jan Krajdl
9cd0b520c2 Added keep open boolean field to Stock Location modal form (#11074)
* Added keep open boolean field to Stock Location modal form

* Rewrite keep form open field feature to avoid calling methods in form field definitions

* Rewrite keep form open feature as common form property

* Removed unused artefact from previous implementation

* keepOpenOption removed as default option for all create forms. Instead it's enabled on selected forms.

* keepOpenOption field speed improvement

- using useRef instead of useState
- keepOpenSwitch moved to own component

* Added keep form open feature to changelog

* Updated documentation: keep form open feature added to concepts/user_interface docs

* Added test case for "keep form open" feature

* Changed switch selector in keep form open feature test

---------

Co-authored-by: spm <jan.krajdl@cecolo.com>
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
2026-03-29 15:09:47 +11:00
Matthias Mair
8b67fe5e99 fix(frontend): Template Editor Rendering Issues (#11601)
* fix order

* general bump

* allign @codemirror

* fix style

* add playwright test

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2026-03-27 07:29:03 +11:00
Oliver
8e289a3208 [API] Category star fix (#11588)
* [API] Bug fix for PartStar and PartCategoryStar

- Logic refactor and fixes

* Add playwright tests

* Remove debug statements

* Revert API string changes
2026-03-21 23:47:11 +11:00
Oliver
fc730b9af7 Save user info (#11572)
* Record user info when creating stock item

* Add unit test

* Add playwright test
2026-03-20 15:41:44 +11:00
Oliver
7f0610502d Build line fix (#11566)
* Fix for RenderBuildLine

* Simple playwright test
2026-03-20 08:51:21 +11:00
Oliver
4599edd375 [UI Update image fix (#11557)
* Improve thumbnail selector

- Center image
- Better descriptive text

* Updated playwrigth testing
2026-03-19 16:56:13 +11:00
Oliver
488bd5f923 Fix complete_sales_order_shipment task (#11525)
* Fix complete_sales_order_shipment task

- Perform allocation *before* marking shipment as complete
- Ensure task is not marked as complete before it is actually done

* Add unit test

* Provide task status tracking for shipment completion

* Add integration testing

* Address unit test issues

* Bump API version

* Enhance playwright test
2026-03-18 08:05:16 +11:00
Oliver
84cd81d9a8 Build consume fix (#11529)
* Add new build task

* Refactor background task for consuming build stock

- Run as a single task
- Improve query efficiency

* Refactor consuming stock against build via API

- Return task_id for monitoring
- Keep frontend updated

* Task tracking for auto-allocation

* Add e2e integration tests:

- Auto-allocate stock
- Consume stock

* Bump API version

* Playwright test fixes

* Adjust unit tests

* Robustify unit test

* Widen test scope

* Adjust playwright test

* Loosen test requirements again

* idk, another change :|

* Robustify test
2026-03-17 20:51:12 +11:00
Oliver
6830ba5efe [API] Monitor task (#11527)
* Enhance docstring

* Return the ID of an offloaded task

* Add API endpoint for background task detail

* Add UI hook for monitoring background task  progress

* Handle queued tasks (not yet started)

* Improve UX

* Update frontend lib version

* Bump API version

* Fix notification

* Simplify UI interface

* Implement internal hook

* Fix API path sequence

* Add unit tests for task detail endpoint

* Refactor code into reusable model

* Explicit operation_id for API endpoints

* Further refactoring

* Use 200 response code

- axios does not like 202, simplify it

* Return task response for validation of part BOM

* Fix schema

* Cleanup

* Run background worker during playwright tests

- For full e2e integration testing

* Improve hooks and unit testing

* Rename custom hooks to meet react naming requirements
2026-03-15 14:11:22 +11:00
Matthias Mair
d7af345e20 refactor(frontend): use central user creds (#11520) 2026-03-14 13:29:46 +11:00
Matthias Mair
fda3204e33 fix: low-privilege user token creation (#11492)
* [bug] Users cannot create their own API tokens
Fixes #11486

* fix detection of metadata

* make easier to read

* add handler for IsAuthenticated

* use correct method

* fix style see #11487

* add frontend test

* make test more reliable?
2026-03-14 12:02:49 +11:00
dependabot[bot]
7d739e5927 chore(deps): bump the dependencies group across 1 directory with 4 updates (#11494)
* chore(deps): bump the dependencies group across 1 directory with 4 updates

Bumps the dependencies group with 4 updates in the /src/frontend directory: [@codemirror/view](https://github.com/codemirror/view), [@uiw/codemirror-theme-vscode](https://github.com/uiwjs/react-codemirror), [@playwright/test](https://github.com/microsoft/playwright) and [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@codemirror/view` from 6.38.2 to 6.39.16
- [Changelog](https://github.com/codemirror/view/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codemirror/view/compare/6.38.2...6.39.16)

Updates `@uiw/codemirror-theme-vscode` from 4.25.1 to 4.25.7
- [Release notes](https://github.com/uiwjs/react-codemirror/releases)
- [Commits](https://github.com/uiwjs/react-codemirror/compare/v4.25.1...v4.25.7)

Updates `@playwright/test` from 1.56.0 to 1.58.2
- [Release notes](https://github.com/microsoft/playwright/releases)
- [Commits](https://github.com/microsoft/playwright/compare/v1.56.0...v1.58.2)

Updates `@types/node` from 24.11.0 to 25.3.3
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@codemirror/view"
  dependency-version: 6.39.16
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
- dependency-name: "@uiw/codemirror-theme-vscode"
  dependency-version: 4.25.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
- dependency-name: "@playwright/test"
  dependency-version: 1.58.2
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dependencies
- dependency-name: "@types/node"
  dependency-version: 25.3.3
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: dependencies
...

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

* fix test

* fix test

---------

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>
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2026-03-13 10:57:53 +11:00
Matthias Mair
57949b69e0 chore(frontend): resolution bump (#11465)
* chore(frontend): resolution bump

* bump nyc

* bump vite-plugin-istanbul

* bump @codecov/vite-plugin

* bump @lingui

* fix typing

* fix tests

* make more robust

* fix @codemirror

* fix another switch

* add more "give" to test

* ifnore demo dataset

* fix assert

* revert test change

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2026-03-12 12:14:36 +11:00
Oliver
449bd4e5a0 [UI] Copy cells expansion (#11410)
* Prevent copy button if copy value is null

* Add "link" columns to order tables

* Support copy for default column types

* Tweak padding to avoid flickering issues

* Refactor IPNColumn

* Adjust visual styling

* Copy for SKU and MPN columns

* Add more copy columns

* More tweaks

* Tweak playwright testing

* Further cleanup

* More copy cols
2026-02-24 11:44:14 +11:00
Oliver
cef5d4d9c0 [UI] Default table filters (#11405)
* Support "default filters" for table views

- User overrides apply in preference
- Only when there is no stored value (null)

* Correctly handle partially constructed filters

- Reverse lookup on available filter set

* Add default filters for order tables

* Default filters for company tables

* More default filters

* Add some more default filters

* Bump CHANGELOG

* build fix

* Tweaks for playwright testing

* Tweak playwright test

* Improve test flexibility
2026-02-23 19:46:17 +11:00
Oliver
e1a9200f1e [bug] Fix custom logo and splash (#11391)
* Add custom logo and splash to playwright fixtures

* Render custom logo in frontend

* Add playwright tests for customization settings

* Separate playwright run for customization

* Update ci file

* Update playwright config file

* Do not call get_custom_file from withing settings.py

- django app not fully initialized yet
- can cause loops

* Disable default tests (for now)

* Re-enable normal tests

* Update qc checks

* Order of operations?

* Debug output

* Use env

* Add more debug info

* More debug

* Further debug

* Add collectstatic check

* Run normal tests too

* Remove debug prints
2026-02-22 22:04:49 +11:00
Oliver
2e22245255 Auto allocate tracked (#10887)
* Add "item_type" to BuildAutoAllocationSerializer

* Update frontend to allow selection

* Stub for allocating tracked items

* Code for auto-allocating tracked outputs

* Refactor auto-allocation code

* UI updates

* Bump API version

* Auto refresh tracked items

* Update CHANGELOG.md

* docs entry

* Add unit test

* Add playwright testing
2026-02-22 20:15:31 +11:00
Oliver
3910cc5a50 Supplier Part Updates (#11303)
* Add "primary" field to SupplierPart model

* Remove "default_supplier" field from the Part model

* Ensure only one SupplierPart can be "primary" for a given Part

* Update references to "default_supplier"

* Add 'primary' field to the SupplierPart API serializer

* update SupplierPart table

* Use bulk-update operations

* Bug fix for data migration

* Allow ordering by 'primary' field

* Tweak import message

* Edit 'primary' field in UI

* Fix checks in save() methods

* Better table updates

* Update CHANGELOG

* Bump API version

* Fix unit test

* Add unit test for API

* Playwright tests
2026-02-20 18:25:26 +11:00
Oliver
14d6d2354f [Enhancement] Import by natural key fields (#11288)
* Data import flexibility

- Allow specification of alternative lookup fields for data import

* Observe field filters during data import

* Add alternative import fields for Part models

* More options for IMPORT_ID_FIELDS

* Update src/backend/InvenTree/importer/models.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Bump CHANGELOG

* Handle empty input values

* Add IMPORT_ID_FIELDS for more models

* PK field takes highest priority

* Update import docs

* Tweak return type

* Handle multiple date formats

* Add playwright testing

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-20 15:30:00 +11:00
Oliver
dd423dccd6 [API] Enhanced filtering for generic parameters (#11383)
* Enhanced filtering for parameter templates

- Allow filtering by model ID as well as model type

* Enhanced filtering for ParameterTemplate

- Required for the parameteric data tables
- Enable filtering by base model ID
- Enable filtering by related model ID

* Bump API version

* Remove outdated comments

* Fix typo

* Remove debug statement

* Added unit tests

* Playwright tests

* Fix unit test

* Bump requirements

* Revert
2026-02-20 09:32:33 +11:00
Oliver
3ebf27df36 Display more output information in "build allocated stock" table (#11276)
* Add "install_into_detail" to BuildItem serializer

* Enhance the "resolveItem" function

* Add "StockColumn" renderer

* Fix output column for BuildAllocatedStockTable

* Replace column in stock item table

* More column refactoring

* Bump API version

* Add InvenTreeOutputOption descriptions

* Prefetch for better API performance

* Updated playwright testing
2026-02-11 23:25:56 +11:00
Oliver
d24ba7965c [bug] Fix table ordering (#11277)
* Additional filtering options for stock list

* Fix ordering for stock table

* Ordering fix for build order table

* Ordering for supplier parts and manufacturer parts

* SalesOrderLineItem: Order by IPN

* ReturnOrderLineItem table:

- Order by part name
- Order by part IPN

* Update API version to 451

Increment API version to 451 and update changelog.

* Add playwright tests for column sorting

* Add backend tests for API ordering

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2026-02-11 17:52:21 +11:00
Oliver
1c1933b694 [enhancements] Stock tracking enhancements (#11260)
* Data migrations for StockItemTracking

- Propagate the 'part' links

* Enable filtering of stock tracking entries by part

* Enable filtering by date range

* Display stock tracking for part

* Table enhancements

* Bump API version

* Display stock item column

* Ensure 'quantity' is recorded for stock tracking entries

* Add new global settings

* Adds background task for deleting old stock tracking entries

* Docs updates

* Enhanced docs

* Cast quantity to float

* Rever data migration

* Ensure part link gets created

* Improved prefetch for API

* Playwright testing

* Tweak unit test thresholds

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2026-02-10 21:54:35 +11:00
Oliver
b4eeba5e31 [enhancement] Stocktake updates (#11257)
* Allow part queryset to be passed to 'perform_stocktake' function

* Add new options to perform_stocktake

* Allow download of part stocktake snapshot data

* API endpoint for generating a stocktake entry

* Simplify code

* Generate report output

* Dashboard stocktake widget

- Generate stocktake snapshot from the dashboard

* Force stocktake entry for part

* Add docs

* Cleanup docs

* Update API version

* Improve efficiency of stocktake generation

* Error handling

* Add simple playwright test

* Fix typing
2026-02-06 10:21:30 +11:00
Oliver
8f27063e40 [UI] Fix SupplierPartTable (#11253)
* [UI] Fix SupplierPartTable

- Ensure manufacturer_part_detail is fetched too

* Updated playwright tests
2026-02-04 17:18:24 +11:00
Matthias Mair
64650781be deps(frontend): bump mantine packages (#11020)
* bump mantine packages

* bump helpers

* Adjust frontend test

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2026-01-04 09:45:09 +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
ba7b776257 [refactor] Optional prefetch (#11012)
* Automatic prefetch of related fields for enable_filter

- Allows us to *not* prefetch fields (expensive) when they are not going to be used
- Enables re-usable components for common detail fields

* Refactor "project_code_detail" filter into common component

- Automatically apply correct prefetch fields

* Refactor 'parameters' annotation

- add 'enable_parameters_filter' function
- Prefetch parameters only when needed
- Refactor / consolidate code

* Refactor SupplierPartSerializer

- Make fields switchable
- Ensure correct prefetch_related

* Refactor serializer for ManufacturerPart

* Refactor BuildSerializer

* Refactor PurchaseOrderSerializer

* Refactor SalesOrderSerializer

* Refactor ReturnOrderSerializer

* Remove debug statements

* Tweaks

* Simplify custom filterable fields

* Bump API version

* Fix for data export

* Additional unit tests

* Remove unused "prefetch_func" option

* Refactor PurchaseOrderLineItemList

* Refactor SalesOrderLineItemList

* Refactor ReturnOrderLineItem

* Cleanup "pretty_name"

* Fix for build list

* Refactoring StockItem API endpoint

- Needs significant work still

* Refactoring for BuildLineSerializer

* Keep all optional fields when exporting data

* Improve "UserRoles" API endpoint

- Prefetch roles
- Prevents significant number of db hits

* Prefetch Parameter API list

* Bug fix for exporting logic

* Specify InvenTreeOutputOption

* Optional prefetch for primary_address

* Fix typing

* Fix unit test

* fixes for playwright tests

* Update Part API

- Improved prefetching

* Fix for prefetch
2025-12-16 14:46:17 +11:00
Oliver
20c7a5b5b8 Barcode scan tweaks (#10992)
* Remove duplicate tooltip

* Adjust default value

* docs update

* Tweak unit test

* Fix playwright tests
2025-12-11 16:19:47 +11:00
Oliver
ae70c22485 [UI] Barcode form inputs (#10973)
* Add barcode buttons to related fields

- Only field types which support barcodes

* Add per-user settings for barcode support

* Fill form field with scanned data

* Updated docs

* Fix duplicate setting

* Add playwright tests

* Fix duplicate setting in docs

* Fix broken link

* Fix memo deps

* Fix typo

* Remove setting

* Updated playwright tests

* Improved typing
2025-12-07 18:31:32 +11:00
Oliver
fa0d892a62 [WIP] Generic parameters (#10699)
* Add ParameterTemplate model

- Data structure duplicated from PartParameterTemplate

* Apply data migration for templates

* Admin integration

* API endpoints for ParameterTemplate

* Scaffolding

* Add validator for ParameterTemplate model type

- Update migrations
- Make Parameter class abstract (for now)
- Validators

* API updates

- Fix options for model_type
- Add API filters

* Add definition for Parameter model

* Add django admin site integration

* Update InvenTreeParameterMixin class

- Fetch queryset of all linked Parameter instances
- Ensure deletion of linked instances

* API endpoints for Parameter instances

* Refactor UI table for parameter templates

* Add comment for later

* Add "enabled" field to ParameterTemplate model

* Add new field to serializer

* Rough-in new table

* Implement generic "parameter" table

* Enable parameters for Company model

* Change migration for part parameter

- Make it "universal"

* Remove code for ManufacturerPartParameter

* Fix for filters

* Add data import for parameter table

* Add verbose name to ParameterTemplate model

* Removed dead API code

* Update global setting

* Fix typos

* Check global setting for unit validation

* Use GenericForeignKey

* Add generic relationship to allow reverse lookups

* Fixes for table structure

* Add custom serializer field for ContentType with choices

* Adds ContentTypeField

- Handles representation of content type
- Provides human-readable options

* Refactor API filtering for endpoints

- Specify ContentType by ID, model or app label

* Revert change to parameters property

* Define GenericRelationship for linking model

* Refactoring some code

* Add a generic way to back-annotate and prefetch parameters for any model type

* Change panel position

* Directly annotate parameters against different model serializers

* remove defunct admin classes

* Run plugin validation against parameter

* Fix prefetching for PartSerializer

* Implement generic "filtering" against queryset

* Implement generic "ordering" by parameter

* Make parametric table generic

* Refactor segmented panels

* Consolidate part table views

* Fix for parametric part table

- Only display parameters for which we know there is a value

* Add parametric tables for company views

* Fix typo in file name

* Prefetch to reduce hits

* Add generic API mixin for filtering and ordering by parameter

* Fix hook for rebuilding template parameters

* Remove serializer

* Remove old models

* Fix code for copying parameters from category

* Implement more parametric tables:

- ManufacturerPart
- SupplierPart
- Fixes and enhancements

* Add parameter support for orders

* Add UI support for parameters against orders

* Update API version

* Update CHANGELOG.md

* Add parameter support for build orders

* Tweak frontend

* Add renderer

* Remove defunct endpoints

* Add migration requirement

* Require contenttypes to be updated

* Update migration

* Try using ID val

* Adjust migration dependencies

* fix params fixture

* fix schema export

* fix modelset

* Fixes for data migration

* tweak table

* Fix for Category Parameters

* Use branch of demo dataset for testing

* Add parameteric build order table

* disable broken imports

* remove old model from ruleset

* correct test

* Table tweaks

* fix test

* Remove old model type

* fix test

* fix test

* Refactor mixin to avoid specifying model type manually

* fix test

* fix resolve name

* remove unneeded import

* Tweak unit testing

* Fix unit test

* Enable bulk-create

* More fixes

* More unit test tweaks

* Enhancements

* Unit test fixes

* Add some migration tests

* Fix admin tests

* Fix part tests

* adapt expectation

* fix remaining typecheck

* Docs updates

* Rearrange models

* fix paramater caching

* fix doc links

* adjust assumption

* Adjust data migration unit tests

* docs fixes

* Fix docs link

* Fixes

* Tweak formatting

* Add doc for setting

* Add metadata view for parameters

* Add metadata view for ParamterTemplate

* Update CHANGELOG file

* Deconflict model_type fields

* Invert key:value

* Revert "Invert key:value"

This reverts commit d555658db2.

* fix assert

* Update API rev notes

* Initial unit tests for API

* Test parameter create / edit / delete via the API

* Add some more unit tests for the API

* Validate queryset annotation

- Add unit test with large dataset
- Ensure number of queries is fixed
- Fix for prefetching check

* Add breaking change info to CHANGELOG.md

* Ensure that parameters are removed when deleting the linked object

* Enhance type hinting

* Refactor part parameter exporter plugin

- Any model which supports parameters can use this now
- Update documentation

* Improve serializer field

* Adjust unit test

* Reimplement checks for locked parts

* Fix unit test for data migration

* Fix for unit test

* Allow disable edit for ParameterTable

* Fix supplier part import wizard

* Add unit tests for template API filtering

* Add playwright tests for purchasing index

* Add tests for manufacturing index page

* ui tests for sales index

* Add data migration tests for ManufacturerPartParameter

* Pull specific branch for python binding tests

* Specify target migration

* Remove debug statement

* Tweak migration unit tests

* Add options for spectacular

* Add explicit choice options

* Ensure empty string values are converted to None

* Don't use custom branch for python checks

* Fix for migration test

* Fix migration test

* Fix reference target

* Remove duplicate enum in spectactular.py

* Add null choice to custom serializer class

* [UI] Edit shipment details

- Pass "pending" status through to the form

* New migration strategy:

part.0144:
- Add new "enabled" field to PartParameterTemplate model
- Add new ContentType fields to the "PartParameterTemplate" and "PartParameter" models
- Data migration for existing "PartParameter" records

part.0145:
- Set NOT NULL constraints on new fields
- Remove the obsolete "part" field from the "PartParameter" model

* More migration updates:

- Create new "models" (without moving the existing tables)
- Data migration for PartCataegoryParameterTemplate model
- Remove PartParameterTemplate and PartParameter models

* Overhaul of migration strategy

- New models simply point to the old database tables
- Perform schema and data migrations on the old models first (in the part app)
- Swap model references in correct order

* Improve checks for data migrations

* Bug fix for data migration

* Add migration unit test to ensure that primary keys are maintained

* Add playwright test for company parameters

* Rename underlying database tables

* Fixes for migration unit tests

* Revert "Rename underlying database tables"

This reverts commit 477c692076.

* Fix for migration sequencing

* Simplify new playwright test

* Remove spectacular collision

* Monkey patch the drf-spectacular warn function

* Do not use custom branch for playwright testing

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2025-12-04 20:41:36 +11:00
Oliver
5713cff1cb [bug] Stock adjust (#10914)
* Extra checks on backend

* Bug fix for adjustment forms

- Set default quantity of zero

* Additional unit testing (to ensure no regression)
2025-11-26 22:32:57 +11:00
Oliver
e590522909 [UI] Fix for PartTestResultTable (#10886)
* [UI] Fix for PartTestResultTable

- Filter properly by part instance

* Add a simple unit test

* Tweak unit test
2025-11-22 17:20:49 +11:00
Oliver
a76ec0a7b8 [UI] Suggested pricing (#10867)
* Refactor NumberField into separate component

* Add helper func to ensure a number is a number

* Use placeholder value for suggested sale price

* Fix for auto-fill

* Tweak price calculation

* Add UI testing for sales order price breaks

* Fix aria label name

* Annotate price breaks to supplier part

* Fetch price break data

* Support price breaks for purchase order pricing

* Fix required to prevent circular imports

* Add playwright tests for purchase order price breaks

* Bump API version

* Re-add output options for SupplierPriceBreakList

* Revert change

* Simplify unit test
2025-11-20 22:51:27 +11:00
Oliver
7b38fa30bb Fix for shipping virtual parts (#10853)
* Additional checks for virtual parts in sales order process

* Prevent allocation against virtual parts

* Fix order of operations

* Adjust part form fields based on selections

* Prevent order locking

* Updated playwright tests

* Add unit test
2025-11-19 15:40:41 +11:00
Oliver
d06d80fb99 Bug fix for sales order pricing (#10858)
* Bug fix for sales order pricing

- Clear sale price field if no pricing

* Adjust playwright tests
2025-11-19 14:49:51 +11:00
Oliver
770f7a292e [UI] Fix for form OPTIONS query (#10840)
* [UI] Fix for form OPTIONS query

- Fetch OPTIONs each time form is opened
- Ensure default values are filled correctly
- Prevent issues with latching form state

* Add comment

* Add playwright test

- Check that the reference field increments properly

* Fix other Playwright tests
2025-11-16 21:59:27 +11:00
Oliver
ba9b5438b4 Char fix (#10827)
* Remove debouncing from text field

* Add debounce to data import field

* Only apply for strings values

* Fix unit test

* More unit test tweaks
2025-11-14 17:35:59 +11:00
Oliver
d829d3a548 [UI] Order form improvements (#10802)
* Auto-fill supplier parts in order wizard

* Copy supplier part SKU from order parts wizard

* Add "on_order" filter to BuildLine table

* Allow ordering by production and ordering quantities

* Allow specification of purchase price

* Bump API version

* Adjust UI testings
2025-11-11 17:29:18 +11:00
Matthias Mair
5d21bf2679 feat(backend)!: bump to dj 5.2 lts / py 3.11 (#10730)
* feat(backend): bump to 5.2 lts / python 3.11

This will give us support till 2027-10 (PEP 664)

* bump dependencies

* fix dflt version

* remove 3.9 precaution

* changes for 5.2

* changes for py 3.10

* debug command

* lower crypto again

* another lowering

* fix version string

* lower minimum version to 3.11

* update refs

* fix text

* reaking: remove now unsupported OS

* disable break

* remove temp changes

* fix ruff call

* fix remaining ruff warnings

* remove old arg

* lower allauth reqs

* replace old method

* fix issue with args passing beeing depreceated

* add changelog entries

* bump dependencies a bit further

* fix broken image init for now
might need a refactor

* fix another test

* refactor image name lookup

* mroe refactoring

* ensure str does not cause an issue

* update referenced function

* fix cal sig

* simplify method and add test

* refactor

* ignore wrong typings

* fix deprecated feature

* simplify

* ensure image tests do their job

* simplify

* re-add type check

* fix test

* fix assertations - wonder how long this was broken

* bump to newer versions

* bump deps

* fix assertation
2025-11-11 11:45:25 +11:00
Oliver
2dfe6b5f41 [UI] MFA Refactor (#10775)
* Install otpauth package

* Add separate MFASettings components

* Refresh methods after registering token

* Simplify layout

* Add modal for deleting TOTP code

* Display recovery codes

* Adjust text

* Register webauthn

* Add longer timeouts

* Add workflow for removing webauthn

* Cleanup SecurityContext.tsx

* Add playwright testing for TOTP registration

* Spelling fixes

* Delete unused file

* Better clipboard copy
2025-11-05 22:54:47 +11:00
Oliver
8e20bc53db Consolidate data actions for BOM table (#10763)
* Consolidate data actions for BOM table

* Adjust playwright tests
2025-11-04 12:02:00 +11:00
Oliver
16a753bf59 [UI] Plugin actions (#10720)
* Add backend code for custom actions

* docs

* Add sample action code

* Fetch plugin features

* Load plugins and call function

* Support icons

* Alert message

* Update CHANGELOG.md

* Rename action type

* Update docs

* pdated playwright tests
2025-10-31 09:41:32 +11:00