2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-01-29 01:23:37 +00:00
Commit Graph

1364 Commits

Author SHA1 Message Date
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
dependabot[bot]
d43c4e08f0 chore(deps): bump lodash from 4.17.21 to 4.17.23 in /src/frontend (#11184)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-22 11:22:02 +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
Oliver
c15805db67 [UI] Sort category by path (#11170)
- Enable category table sorting by "pathstring"
2026-01-20 15:33:39 +11:00
Sam W
6311f75201 [ui] Show generated serial numbers as placeholder when receving stock (#11147) 2026-01-20 07:54:07 +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
Oliver
31f32c3753 [UI] Fix "assign to customer" (#11151)
- Hide if base part is not salable
- Closes https://github.com/inventree/InvenTree/issues/11134
2026-01-17 21:18:28 +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
Gustaf Järgren
bd519487e5 [UI] Fix "Owner" detail badge using wrong id (#11144) 2026-01-17 15:54:08 +11:00
Oliver
59f93ca413 [UI] Default supplier fix (#11142)
* [UI] Fix "default supplier" form

- Select the supplier part instance

* Hide field if part is not purchaseable

* Fix supplier part display
2026-01-17 15:53:34 +11:00
Oliver
c89e3bdfea Enhance stock merge (#11141)
- Improve location selection
2026-01-16 11:26:38 +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
Oliver
76cfb442a4 [UI] Bug fix for table column reordering (#11131)
* [UI] Bug fix for table column reordering

- Ref: https://github.com/icflorescu/mantine-datatable/issues/759
- Adds hash to column cache key based on provided columns
- Prevent infinite loop for react hooks

* Remove previous cache approach

* Remove unused code
2026-01-14 10:44:27 +11:00
Oliver
f2cef4f266 [UI] Improved flow for 409 errors (#11132) 2026-01-14 09:56:14 +11:00
Oliver
dc4861210c [bug] Fix for "Cancel Build Outputs" form (#11130)
- Do not display editable quantity field
2026-01-14 09:10:15 +11:00
Oliver
ec0fd650ca Log boundary errors to console (#11125) 2026-01-13 17:19:08 +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
Oliver
91a5c338e1 [ui] tweak inline display of supplier part (#11090)
- Hide pack quantity for single units
2026-01-07 14:03:41 +11:00
Oliver
8eff5ff59a [ui] fix line item pricing (#11091)
- Fix bug where line item pricing was retained across forms
2026-01-07 14:03:31 +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
Oliver
d92672d0d9 Fix BOM pie tool tips (#11086)
- Do not use "segment" pricing
- Leads to a strange visual bug
2026-01-06 16:17:25 +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
c032607921 Fix for data importer (#11076)
* Fix for data importer

- Ensure the "progress" stepper updates

* Prevent query with invalid PK

* Reduce useless API calls

- Instantiate column mappings with proper defaults
- Ignore duplicate updates
- Increase debounce times
2026-01-03 20:32:43 +11:00
Oliver
97dd664073 Rename PartParameterPanel to ParameterPanel (#11061) 2025-12-23 15:00:28 +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
Matthias Mair
2eccf13c93 Default Supplier Support Missing in 1.X.X (#10980)
Fixes #10979
2025-12-16 22:12:35 +11:00
Oliver
c78b03b6ff [ui] Table fix (#11022)
* Optimize printing actions

- Don't fire API request until dialog is opened
- This prevents a lot of unnecessary API calls from the UI

* Do not fire export options query until required
2025-12-16 18:15:32 +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
0723c74567 [UI] Spotlight Updates (#10994)
- Fix broken "admin" action
- Add action to jump to plugins page
2025-12-11 16:19:37 +11:00
Oliver
c5548aabde [security] Bump react deps (#10991) 2025-12-10 23:02:06 +11:00
github-actions[bot]
3ca124c1a9 New Crowdin translations by GitHub Action (#10960)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-08 15:27:59 +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
Matthias Mair
a0cfdd72a5 fix(frontend): deps (#10970)
https://github.com/inventree/InvenTree/security/dependabot/260
https://github.com/inventree/InvenTree/security/dependabot/243
https://github.com/inventree/InvenTree/security/dependabot/258
https://github.com/inventree/InvenTree/security/dependabot/257
2025-12-07 07:04:06 +11:00
Oliver
efc8fb816d Fix for string form fields (#10814)
* Fix for string form fields

- replace null values with empty strings

* Expose more serializer metadata

* Check if null values are not allowed

* Fix type

* Try removing feature

* Reduce deltas

* Remove extra field attrs entirely (for testing)

* Comment out changes

* Tweak form values

* Fix for form validation
2025-12-06 22:54:29 +11:00
Oliver
3a18934b83 Obvserve default values for part forms (#10964)
- Closes https://github.com/inventree/InvenTree/issues/10909
- Use global setting values as defaults
2025-12-06 20:20:39 +11:00
github-actions[bot]
d0c23bd523 New Crowdin translations by GitHub Action (#10957)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-06 10:19:00 +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
3e35f439c0 [UI] Edit shipment details (#10944)
- Pass "pending" status through to the form
2025-12-03 17:28:13 +11:00
Matthias Mair
c8b1bfb716 refactor (frontend): address code scanning issues (#10935)
* remove unused defs

* optimize

* revert rename
2025-12-02 18:11:02 +11:00
Oliver
c224606d8d [UI] refactor "inactive alerts" panel (#10913)
* Remove "inactive alerts" panel

* Improve messaging / colors

* Refactor to "system status" display

* remove duplicate messages

* Revert alert messages

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2025-12-01 23:07:26 +11:00
github-actions[bot]
bc5c306b6d New Crowdin translations by GitHub Action (#10871)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2025-11-30 21:03:53 +11:00
Oliver
3b6b702bd5 Stock availability docs (#10927)
* Add deficit stock badge

* screenshots

* Add "stock availability" page

* Update stock index page
2025-11-28 12:54:16 +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
df6cbca197 Check / uncheck shipments from table (#10907) 2025-11-25 23:19:18 +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
d5ee647c6e [ui] Label fix (#10874)
* Fix for sales order allocations:

- Improve UX
- Clearer intent

* Same fix for build order

* Also for build line sub table
2025-11-21 12:43:01 +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
github-actions[bot]
f72efb804e New Crowdin translations by GitHub Action (#10736)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-11-20 21:39:11 +11:00