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

23 Commits

Author SHA1 Message Date
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
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
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
551da5a51f Bump version number to 1.2.0 dev (#10734)
* Bump version number to 1.2.0 dev

* Add release tag to CHANGELOG.md

* Add entry for upcoming 1.2.0

* Cleanup

* Remove links
2025-11-02 10:01:16 +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
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
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
Matthias Mair
f47a1a4675 refactor(backend): switch to empty buildpack for package, extend supported OS versions (#10705)
* bump vers

* fix ssl?

Added build dependencies for libbz2, libffi, and libssl.

* try empty buildpack

* clean up

* fix ref

* remove things we now do not need anymore

* add 22.04 as a target

* cleanup installer

* add changelog entry

* add dotenv

* update skript

* make task more robust for package usage

* ensure we have a site-url set

* fix style

* fix syntax
2025-10-29 11:26:40 +11:00
Matthias Mair
2e4b1d65f7 feat(frontend): add passkey/webauthn for secondary MFA (#9729)
* bump allauth

* add trust

* add device trust handling

* fix style

* [FR] Add passkey as a factor
Fixes #4002

* add registration

* allow better testing

* add mfa context

* fix login

* add changelog entry

* fix registration

* remove multi device packages

* move to helper

* handle mfa trust

* simplify page fnc
2025-10-28 18:52:39 +11:00
Oliver
96dfee4018 [feature] Project code per line (#10657)
* Add project code to line items

* Refactor AbstractOrderSerialiazer

* Refactor AbstractOrderLineItem serializer

* Refactoring for AbstractExtraLineSerializer

* UI elements for extra line item project code

* UI for ReturnOrderLineItems

* UI elements for SalesOrderLineItem

* UI elements for PurchaseOrderLineItem

* Docs updates

* Update API version and CHANGELOG
2025-10-24 15:10:58 +11:00
Oliver
6df97e83f5 [UI] Implement "checked_by" for SalesOrderShipment (#10654)
* Add "checked" column to SalesOrderStatus table

* Add API filter for "checked" status

* Add Checked / Not Checked badge

* Add actions to check / uncheck shipment

* Add modal for changing checked_by status

* Display checked_by user

* Tweak wording

* Bump API version

* Update CHANGELOG file

* Update docs

* Add new global setting

- Prevent shipment completion which have not been checked

* Test if shipment has been checked

* Updated unit tests

* Updated type hinting

(may as well while I'm here)

* Adjust shipment icon

* Add "order_outstanding" filter for SalesOrderShipment table
2025-10-24 13:39:57 +11:00
Oliver
ec33c57e85 SalesOrderShipment address (#10650)
* Adds "shipment_address" attribute to the SalesOrderShipment model:

- Allows different addresses for each shipment
- Defaults to the order shipment address (if not specified)

* Add unit testing for field validation

* Update SalesOrderShipment serializer

* Edit shipment address in UI

* Render date on shipment page

* Improve address rendering

* Update docs

* Bump API version

* Update CHANGELOG.md

* Fix API version
2025-10-23 16:37:43 +11:00
Lukas Wolf
de270a5fe7 Supplier Mixin (#9761)
* commit initial draft for supplier import

* complete import wizard

* allow importing only mp and sp

* improved sample supplier plugin

* add docs

* add tests

* bump api version

* fix schema docu

* fix issues from code review

* commit unstaged changes

* fix test

* refactor part parameter bulk creation

* try to fix test

* fix tests

* fix test for mysql

* fix test

* support multiple suppliers by a single plugin

* hide import button if there is no supplier import plugin

* make form submitable via enter

* add pui test

* try to prevent race condition

* refactor api calls in pui tests

* try to fix tests again?

* fix tests

* trigger: ci

* update changelog

* fix api_version

* fix style

* Update CHANGELOG.md

Co-authored-by: Matthias Mair <code@mjmair.com>

* add user docs

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2025-10-18 07:13:03 +11:00
Oliver
759c882a95 Allow adjument of build outputs (#10600)
* Auto-select location

* Allow stock adjustments for "in production" items

* Tweak stock move check

* Allow splitting of production stock

* Update CHANGELOG.md
2025-10-17 11:53:51 +11:00
Oliver
c2ade84872 Plugin stock forms (#10584)
* Expose stock adjustment forms to plugins

* Update changelog

* Expand type exports

* Update CHANGELOG.md
2025-10-15 09:08:38 +11:00
Austen Hoogen
466463ad74 Enhancement: Support Redis ACL User Logins (#10551)
* Adding support for modern Redis ACL user-baased auth

* Reverting pre-config

* Simplified to combine legacy and acl redis connection uris

---------

Co-authored-by: Austen Hoogen <austenwho@protonmail.com>
2025-10-13 09:53:24 +11:00
Matthias Mair
49f8f72a46 chore(backend)!: fix spelling (#10557)
* fix spelling

* add changelog entry
2025-10-13 07:06:14 +11:00
Oliver
5743e22501 Partial build output complete (#10499)
* Handle partial completion of build output

* Add 'quantity' field to BuildOutputComplete API endpoint

* Allow partial scrapping of build outputs

* Adjust column text

* Adjust "complete build output" form

* Change order of operations when completing build output

- Run validation checks *before* potentially splitting stock item

* Extract quantity from serializer

* Documentation

- Update screenshots
- Add note on partial completion
- Add note on partial scrapping

* Update CHANGELOG.md

* Update API version

* Add unit test for partial scrapping

* Tweak text

* Unit test for partial output completion

* Fix validation check for quantity field

* Adjust playwright tests
2025-10-06 14:30:07 +11:00
Lukas
66a488b6a2 Machine properties and periodic ping (#10381)
* add machine properties

* remove non working polyfill

* add periodic task

* add tests and docs

* fix ping task

* add int and float type

* Update api_version.py

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2025-10-06 09:01:53 +11:00
Matthias Mair
230639bdad chore: cleanup changelog for 1.0 (#10457) 2025-10-02 21:37:46 +10:00
Matthias Mair
7638092ab8 feat(backend): releax protocol check (#10454)
* feat(backend): releax protocol check

* add changelog entry

* fix variable name

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2025-10-02 21:36:37 +10:00
Oliver
3527e1a359 [Report] Queryset ordering (#10439)
* docs

* Add new helper

* Update CHANGELOG
2025-10-01 15:57:07 +10:00
Matthias Mair
b89a7c45d6 feat(docs): Add (high level) Changelog (#9841)
* Embed release notes into documentation
Fixes #4959

* added first few lines for 1.0

* cleanup old changelog
2025-07-31 00:18:10 +10:00