* Throw error on invalid site access policy
- If ALLOWED_HOSTS is empty, exit
- If CSRF_TRUSTED_ORIGINS is empty, exit
- Closes https://github.com/inventree/InvenTree/issues/6730
* Set parameters for devcontainer
* Update documentation
* Ignore server exit in testing mode
* Add INVENTREE_SITE_URL to CI
* Further CI updates
* Update settings.py
* Unit test updates
* More unit test updates
* Bump API version
* Re-introduce checks in settings.py
- Allow more lenient behaviour in TESTING mode
* Fix "BuildLine" label in PUI
- Point to "buildline" not "build"
* Prevent escape closing template ediror
* Update report docs
* Fix for format_number
- Prevent number from being represented as scientific notation
* Validate timezone in settings.py
* Add helper functions for timezone information
- Extract server timezone
- Convert provided time to specified timezone
* Add more unit tests
* Remove debug print
* Test fix
* Add report helper tags
- format_date
- format_datetime
- Update report templates
- Unit tests
* Add setting to control report errors
- Only log errors to DB if setting is enabled
* Update example report
* Fixes for to_local_time
* Update type hinting
* Fix unit test typo
* In debug mode, allow CORS from localhost origins
- Should allow more reliable connection from the vite frontend dev server
* Allow regex pattern to be specified externally
* Update docs
* Added first POC for label editor
* Added preview item selection
* Split code
* Fix import
* Use liquid lang and added custom tooltips
* Auto load first item for preview and add BOM part assembly filter
* Make the save&reload action more obvious
* Make save optional and use server stored template
* Fix icons and inherit model url
* Add label/report extra fields to serializer and default templates
* Bump api version to v176
* Remove generic and pass template to editor
* Added error overlay
* Moved default tempaltes in default folder
* Only show detail drawer back button if necessary
* Rename action dropdown disabled to hidden and add loading disabled to template editor
* Fix types
* Add icons to editor/preview tabs
* Add draggable split pane and make editors use full height
* Add SplitButton component
* add code editor tag description
* fix related model field if empty string
* remove debug console.log
* move code editor/pdf preview into their own folder
* Update api_version.py
* add support for multiple editors
* fix template editor error handleing while loading/saving code
* add documentation for the template editor
* remove docker-sqlite file
- Do not want to encourage use of sqlite
* Add Caddyfile
* Add default site URL to .env
- Matches Caddyfile
* Cleanup / simplify .env file
* Remove dev nginx conf file
* Further cleanup of .env file
* Update docker-compose.yml
- Use caddy image instead of nginx as proxy
* Set max body size
* gunicorn: enable external logging
* Update file structure
* Cleanup docker-compose file
* Update docker/docker-compose.yml
Co-authored-by: Matthias Mair <code@mjmair.com>
* Update docker/Caddyfile
Co-authored-by: Matthias Mair <code@mjmair.com>
* Fix for postgresql packages
- Need postgresql13-client to be installed, it contains pg_dump
- Without this, backup / restore *does not work*
* Create static_i18n dir if it does not exist
* Reduce output from collectstatic
* Revert gunicorn logging
- Want to see the logs in docker
* Fix trailing slash
Ref: https://github.com/inventree/InvenTree/pull/6551#issuecomment-1962423765
* tasks.py - pass 'nouv' option through
* Update package requirements:
- Allow installation of rapidfuzz without building
* Install uv as part of docker image
* Add environment variable to control downstream URL
* Do not use uv package manager by default
- Currently does not work "correctly" - ignores installed packages
- Requires further work to run reliably
* Fix docker-compose file
- Do not build locally
* Cleanup gunicorn file
- Remove unused lien
* Cleanup docker-compose.yml
- Simpler volume management
* Update Caddyfile
Add newline
* Update requirements.txt
Add newline
* Update tasks.py
Add missing blank line
* Simplify Caddyfile
* Adds option for customizing web port
* cleanup docker-compose.yml
- Better mapping of caddy data
- Cleaner volume setup
* Add django version template
- Ensure all docs links point to the current django version we are using
* docs: cleanup intro.md
* Cleanup serving_files.md
* Cleanup config.md
* docker install docs updates
* Enable code block copying
* Fix include file
* Fix link
* Update docker install docs
* Update docker.md
* Add info about demo dataset
* Tweak heading
* Update docs link checks
* Fix workflow
* Another fix
* More ignore pattearns
---------
Co-authored-by: Matthias Mair <code@mjmair.com>
* [FR] Add config option to fully disable installing plugins
Fixes#6531
* also restrict uninstalling
* Added test
* diff cleanup
* extend api to show if install was disabled
* PUI disable install buttons
* CUI disable install button if not available
* add config option
* Rephrase
* Add new field to PartTestTemplate model
- 'enabled' field
- default = True (backwards compatibility)
- Allows tests to be disabled
- Retains test results but disables test
* Update PartTestTemplate API
- Expose new field
- Enable filtering by field
* CUI updates
- Add to PartTestTemplate table
* PUI: Update PartTestTemplateTable
* Update getRequiredTests
- By default, filter out tests which are "disabled"
* Update StockItemTestResult table
- Only display "enabled" tests
- Update CUI
- UPdate PUI
* Update existing build output table
* Bump API version
* Docs updates
* Updated unit tests
* Add basic table for stock item test results
* Improve custom data formatter callback
* Custom data formatter for returned results
* Update YesNoButton functionality
- Add PassFailButton with custom text
* Enhancements for stock item test result table
- Render all data
* Add placeholder row actions
* Fix table link
* Add option to filter parttesttemplate table by "inherited"
* Navigate through to parent part
* Update PartTestTemplate model
- Save 'key' value to database
- Update whenever model is saved
- Custom data migration
* Custom migration step in tasks.py
- Add custom management command
- Wraps migration step in maintenance mode
* Improve uniqueness validation for PartTestTemplate
* Add 'template' field to StockItemTestResult
- Links to a PartTestTemplate instance
- Add migrations to link existing PartTestTemplates
* Add "results" count to PartTestTemplate API
- Include in rendered tables
* Add 'results' column to test result table
- Allow filtering too
* Update serializer for StockItemTestResult
- Include template information
- Update CUI and PUI tables
* Control template_detail field with query params
* Update ref in api_version.py
* Update data migration
- Ensure new template is created for top level assembly
* Fix admin integration
* Update StockItemTestResult table
- Remove 'test' field
- Make 'template' field non-nullable
- Previous data migrations should have accounted for this
* Implement "legacy" API support
- Create test result by providing test name
- Lookup existing template
* PUI: Cleanup table
* Update tasks.py
- Exclude temporary settings when exporting data
* Fix unique validation check
* Remove duplicate code
* CUI: Fix data rendering
* More refactoring of PUI table
* More fixes for PUI table
* Get row expansion working (kinda)
* Improve rendering of subtable
* More PUI updates:
- Edit existing results
- Add new results
* allow delete of test result
* Fix typo
* Updates for admin integration
* Unit tests for stock migrations
* Added migration test for PartTestTemplate
* Fix for AttachmentTable
- Rebuild actions when permissions are recalculated
* Update test fixtures
* Add ModelType information
* Fix TableState
* Fix dataFormatter type def
* Improve table rendering
* Correctly filter "edit" and "delete" buttons
* Loosen requirements for dataFormatter
* Fixtures for report tests
* Better API filtering for StocokItemTestResult list
- Add Filter class
- Add option for filtering against legacy "name" data
* Cleanup API filter
* Fix unit tests
* Further unit test fixes
* Include test results for installed stock items
* Improve rendering of test result table
* Fix filtering for getTestResults
* More unit test fixes
* Fix more unit tests
* FIx part unit test
* More fixes
* More unit test fixes
* Rebuild stock item trees when merging
* Helper function for adding a test result to a stock item
* Set init fix
* Code cleanup
* Cleanup unused variables
* Add docs and more unit tests
* Update build unit test
* Allow simpler setting for CSRF_TRUSTED_ORIGINS and CORS_ALLOWED_ORIGINS
- If these are not specified by the user, but a SITE_URL *is* specified, then use that
* Update docs
* Update config.md
Remove outdated notes
* Added initial draft for machines
* refactor: isPluginRegistryLoaded check into own ready function
* Added suggestions from codereview
* Refactor: base_drivers -> machine_types
* Use new BaseInvenTreeSetting unique interface
* Fix Django not ready error
* Added get_machines function to driver
- get_machines function on driver
- get_machine function on driver
- initialized attribute on machine
* Added error handeling for driver and machine type
* Extended get_machines functionality
* Export everything from plugin module
* Fix spelling mistakes
* Better states handeling, BaseMachineType is now used instead of Machine Model
* Use uuid as pk
* WIP: machine termination hook
* Remove termination hook as this does not work with gunicorn
* Remove machine from registry after delete
* Added ClassProviderMixin
* Check for slug dupplication
* Added config_type to MachineSettings to define machine/driver settings
* Refactor helper mixins into own file in InvenTree app
* Fixed typing and added required_attributes for BaseDriver
* fix: generic status import
* Added first draft for machine states
* Added convention for status codes
* Added update_machine hook
* Removed unnecessary _key suffix from machine config model
* Initil draft for machine API
* Refactored BaseInvenTreeSetting all_items and allValues method
* Added required to InvenTreeBaseSetting and check_settings method
* check if all required machine settings are defined and refactor: use getattr
* Fix: comment
* Fix initialize error and python 3.9 compability
* Make machine states available through the global states api
* Added basic PUI machine admin implementation that is still in dev
* Added basic machine setting UI to PUI
* Added machine detail view to PUI admin center
* Fix merge issues
* Fix style issues
* Added machine type,machine driver,error stack tables
* Fix style in machine/serializers.py
* Added pui link from machine to machine type/driver drawer
* Removed only partially working django admin in favor of the PUI admin center implementation
* Added required field to settings item
* Added machine restart function
* Added restart requird badge to machine table/drawer
* Added driver init function
* handle error functions for machines and registry
* Added driver errors
* Added machine table to driver drawer
* Added back button to detail drawer component
* Fix auto formatable pre-commit
* fix: style
* Fix deepsource
* Removed slug field from table, added more links between drawers, remove detail drawer blur
* Added initial docs
* Removed description from driver/machine type select and fixed disabled driver select if no machine type is selected
* Added basic label printing implementation
* Remove translated column names because they are now retrieved from the api
* Added printer location setting
* Save last 10 used printer machine per user and sort them in the printing dialog
* Added BasePrintingOptionsSerializer for common options
* Fix not printing_options are not properly casted to its internal value
* Fix type
* Improved machine docs
* Fix docs
* Added UNKNOWN status code to label printer status
* Skip machine loading when running migrations
* Fix testing?
* Fix: tests?
* Fix: tests?
* Disable docs check precommit
* Disable docs check precommit
* First draft for tests
* fix test
* Add type ignore
* Added API tests
* Test ci?
* Add more tests
* Added more tests
* Bump api version
* Changed driver/base driver naming schema
* Added more tests
* Fix tests
* Added setting choice with kwargs and get_machines with initialized=None
* Refetch table after deleting machine
* Fix test
---------
Co-authored-by: Matthias Mair <code@mjmair.com>
* Add BOM creation to ther sofa example
* Fixed typo
* Update examples.md
Cleanup wording a bit
---------
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Use registry.get_plugin()
- Instead of registry.plugins.get()
- get_plugin checks registry hash
- performs registry reload if necessary
* Add PluginValidationMixin class
- Allows the entire model to be validated via plugins
- Called on model.full_clean()
- Called on model.save()
* Update Validation sample plugin
* Fix for InvenTreeTree models
* Refactor build.models
- Expose models to plugin validation
* Update stock.models
* Update more models
- common.models
- company.models
* Update more models
- label.models
- order.models
- part.models
* More model updates
* Update docs
* Fix for potential plugin edge case
- plugin slug is globally unique
- do not use get_or_create with two lookup fields
- will throw an IntegrityError if you change the name of a plugin
* Inherit DiffMixin into PluginValidationMixin
- Allows us to pass model diffs through to validation
- Plugins can validate based on what has *changed*
* Update documentation
* Add get_plugin_config helper function
* Bug fix
* Bug fix
* Update plugin hash when calling set_plugin_state
* Working on unit testing
* More unit testing
* Move get_plugin_config into registry.py
* Move extract_int into InvenTree.helpers
* Fix log formatting
* Update model definitions
- Ensure there are no changes to the migrations
* Comment out format line
* Fix access to get_plugin_config
* Fix tests for SimpleActionPlugin
* More unit test fixes
* Fix docs for INVENTREE_SITE_URL
* Adjust default SITE_ID
* Optional support for multi-site
- Disable by default
* Prevent site setting from being changed if set by config parameter
* Update site url setting on server launch
* Update log messages
* Update RULESET_MODELS
* Update unit tests
* More fixes for unit tests
* Update docs
* Update SSO image
* Fix API endpoint URLs
* Adds "authenticated" field to root API endpoint
* Load global status data separately
- Create new global state manager
- Load *after* login
- Prevents auth popup dialog and failure messages
* Add launch config for frontend dev
* Update docs
* Clear token auth if no token is defined
* remove unneeded import
* Revert format of InfoView endpoint
* Remove "authenticated" from InfoView
* Refactor is_staff token check
- Using new get_token_from_request method
* Cleanup code
- return early
* URL fixes
- More fixes for incorrect api calls
* Better tracking of authenticated status
- track an internal flag in apiState
* Prioritize token auth
* Only fetch userState if authenticated
* Force unauthenticated state on first launch
* Updates to login procedure
- Rename doClassicLogin to doBasicLogin (reflecting "basic" auth)
- Add "loggedIn" attribute to sessionState
- Cleanup procedure for securing a token
* Abort early on checkLoginState
- Prevent failed calls to user_me
* Refactoring
- Simpler to just track token state
- No need for separate status tracker
- Works much cleaner this way
* Remove debug messages
* Cleanup unused imports
* Fix unused variable
* Revert timeout to 2000ms
* Rename doClassicLogout -> doLogout
* Improvements for checkLoginState
- Account for the presence of a CSRF session cookie
- If available, use it to fetch a token
* Clear CSRF cookie on logout
- Forces logout from session
- Tested, works well!
- Clean up notifications
* Cleanup setApiDefaults method
* fix global logout (PUI -> CUI)
---------
Co-authored-by: Matthias Mair <code@mjmair.com>
* move more paths to basic path
* changed url route to only match fully - fixed test
* revert path changes on labelprint pages
* fix not found/redirect
* revert test change
* Remove support for django-debug-toolbar
- Will not be effective with new react interface
- Performance is too slow for use anyway
* Fix requirements-dev.txt
* factored out user creation step
* [FR] Support creating reading initial superuser account password from file
Fixes#5471
* added docs
* use env too with password file
* do not warn if passwordfile is set
* Patch for django-allauth 0.55.0
- Some breaking changes here
- Add logger error if auth provider cannot be imported
- Fix for API endpoints
* Only provide URLs for configured plugins
* Update for django-allauth 0.56.0
- Remove support for keycloak
- Remove example from configuration template
* Update django-allauth in requirements.txt
* Update requirements.in
* Refactor SSO functions into common file
* Update config template file
* Update docs
* Fix template files
* Log SSO exceptions to the database
- WIll help greatly with debugging installs
* Add note about error handling in docs
* Bug fix for BarcodePOReceive endpoint
- Existing scan must match "stockitem" to raise an error
* bug fix: barcode.js
- Handle new return data from barcode scan endpoint
* Add barcode endpoint for allocating stock to sales order
* Improve logic for preventing over allocation of stock item to sales order
* Test for sufficient quantity
* Bump API version
* Bug fix and extra check
* Cleanup unit tests
* Add unit testing for new endpoint
* Add blank page for app sales orders docs
* Add docs for new barcode features in app
* Fix unit tests
* Remove debug statement
* Fix errors in variable names of examples
* Added drop down example
* Added drop down example
* Fixed picture name
* Fixed context variable in purchase order report
* Store data from example panel
* Store data from example panel
* Store data from example panel