2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-12-15 16:58:14 +00:00
Commit Graph

1328 Commits

Author SHA1 Message Date
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
Oliver
468efbacfc [UI] Delete stock fix (#10868)
* Add helper func getOverviewUrl

* Redirect to parent page when stock item is counted to zero
2025-11-20 06:34:25 +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
40fbb4d810 Offload stock consume operations (#10856)
- These can be expensive if there are a lot of allocated items
- Offload to the background worker
2025-11-19 15:40:24 +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
2799c4d1fe Specify python version in netlify.toml (#10859) 2025-11-19 13:55:34 +11:00
Oliver
57a2de6ffc [UI] Remove duplicate action (#10844)
- "Build Output" is same as "stock item" in this case
2025-11-17 19:52:35 +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
39d181ae5f Make icons red again (#10816) 2025-11-14 18:12:41 +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
0790dfff5b [UI] Auto-fill stock allocation for build order (#10819)
* Auto-fill stock allocation for build order

* Auto-fill allocation for sales orders

* Prevent recursive auto-fills
2025-11-13 23:16:32 +11:00
Oliver
af6cce3aba [UI] Duplicate supplier part (#10809)
* Allow duplication of supplier part

* Bug fix for pack quantity display

* Allow duplication of ManufacturerPart
2025-11-12 00:08:45 +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
Oliver
77f80385c9 Fix for pricing display (#10804) 2025-11-11 16:19:20 +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
Matthias Mair
b048ca3a04 refactor (frontend): reduce message and time in recovery codes (#10778)
* reduce showing of wrong info boxes

* stop waiting 30 sec when there is an error
2025-11-06 10:44:03 +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
d12102ba96 PurchaseOrderForms tweaks (#10773)
- Small visual changes
- Small bug fix for null record
2025-11-05 10:21:55 +11:00
Oliver
dbb799a0e0 [UI] BOM part category (#10772)
* Add "Category" column to BOM Table

* Enable sorting by category in BOM table

* Add Category column to Buildline table

* Add Category filter to BuildLineTable

* Adjust queryset prefetch

* Bump API version and update CHANGELOG
2025-11-05 10:04:28 +11:00
Oliver
2bc2966d22 Reduce text size (#10764)
- Smaller text for table hovercards
2025-11-04 15:00:52 +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
0997a18a62 Move "view" actions to the end of the list (#10749) 2025-11-03 14:28:31 +11:00
Oliver
91489e986c UI table updates (#10748)
- Add "IPN" col to SupplierPartTable
- Add "IPN" col to ManufacturerPartTable
2025-11-03 13:47:26 +11:00
github-actions[bot]
9d6f30b802 New Crowdin translations by GitHub Action (#10685)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-11-01 14:54:42 +11:00
Oliver
5ea39936b8 Order parts form (#10729)
* Improved SupplierPart rendering

* Adjust tooltips

* Remove debug msg

* Add component for loading and displaying part requirements

* Improved rendering

* Better icons
2025-11-01 10:14:53 +11:00
Oliver
442a616432 Support attachments against SupplierPart (#10724)
* Support attachments against SupplierPart

* Update CHANGELOG.md

* API update
2025-10-31 21:23:23 +11:00
Oliver
0527d78ae6 Report helpers (#10726)
* New report functions:

- create_currency: Create a new Money object
- convert_currency: Convert from one currency to another

* docs

* More checking on report tags

* Better formatting of report errors

* Add unit tests

* Remove error message

* Fix pathing for docs

* Add type hints

* Adjust unit tests
2025-10-31 21:23:10 +11:00
Oliver
46ea541bc4 Push BOM validation to background worker (#10727)
- Can take a significant amount of time
- Closes https://github.com/inventree/InvenTree/issues/10725
2025-10-31 20:41:31 +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
Akhil Singh
8d1f7f39b4 Fix selection list items not displaying values (#10722)
Fixes #10701

The issue was that the table row key was using 'props.item.pk', but the
API returns 'id' instead. This caused React to not properly render the
rows with their values.

Changed the key to use 'props.item.id' with a fallback to 'props.idx'
for new rows that don't have an ID yet.

Signed-off-by: Akhil Singh <singhakhil69@gmail.com>
2025-10-31 08:59:56 +11:00
Matthias Mair
1159418b17 feat(frontend): Add start page with quick actions to Admin Center (#7995)
* add option to set leftMargin

* Add home tab and action button

* make home button actually go to home

* Add general info text

* Add dependeant quick action section

* Add Quickaction to home page

* use Carousel

* style check

* small fixes

* add permanent alerts to Admin Center Home

* also show inactive alerts

* fix order of alerts

* simplify attrs

* remove security section for now

* bring quick actions alive

* adjust text

* Use StylishText

* Make alert columns reactive

* Adjust text formatting

* Refactor <QuickActions />

- Use responsive grid instead of carousel
- Add icons
- Translate text

---------

Co-authored-by: Oliver Walters <oliver.henry.walters@gmail.com>
2025-10-30 22:06:07 +11:00
Oliver
62440893c1 [UI] More actions (#10719)
* Add more spotlight actions:

- Open user settings
- Open system settings

* Add some actions

* Multiple attempts in test code
2025-10-30 22:05:55 +11:00
Matthias Mair
8152ccee99 fix(frontend): webauth action order (#10716) 2025-10-30 14:03:17 +11:00
Matthias Mair
6581af7165 feat(backend): add storages to make usage of s3/sftp easier (#10140)
* feat(backend): add storages to make usage of S3 easy

* add S3/SFTP settings

* add changelog entry

* also configure static

* get it running on hetzner / exo

* doc additional settings

* fix style

* adress various review comments

* move setting files

* use enum for backends

* revert change

* split up storage settings

* fix comparison
2025-10-30 07:57:22 +11:00
Oliver
51babacec0 [UI] Duplicate part fixes (#10709)
* Refactor part duplication

- Move duplication items into the form definition

* Expand to part variants table
2025-10-29 14:28:22 +11:00
Oliver
c7593d983f [UI] Fix BuildLineTable (#10707)
- Closes https://github.com/inventree/InvenTree/issues/10700
2025-10-29 13:46:09 +11:00
Oliver
f2b531bfbb [UI] Fixes (#10697)
* Fix for StockItemTestResultTable

- Fix column alignment

* Update rendering

* Refactor <SupplierPartTable />

- Formalize parameter arguments
2025-10-28 20:18:56 +11:00