Added clarification on how to change the timezone correctly. The documentation -- if carefully read -- explains how to change the timezone but it can be easily missed. I also explicitly mentioned the specific variable that must be set to change the timezone from UTC
(cherry picked from commit 34db1a2a49)
Co-authored-by: aluminum-ice <12374267+aluminum-ice@users.noreply.github.com>
* [UI] Row hover (#9465)
* Add red color
* Improve table cursor
- Show "pointer" (hand) icon when actions available
- Improve context menu
* Fix import
* Updated type hints
* Fix tooltip bug
* Check user when sending notification
* Fix test
* Update unit test
* More unit test fixes
* Tweak playwright tests
* Adjust allowed CORS headers
* Disable caching in template preview
(cherry picked from commit c4f98cd6a1)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Update overdue order notification
- Check individual line items too
* Fix typo
(cherry picked from commit 67bdf3162a)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* [UI] Improve order parts wizard
- Enhance placeholder text
- Precalculate order quantity
* Tweak playwright tests
* Simplify tests
(cherry picked from commit 66d5180d8f)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Add part full name to supplier part table
* Add context variables for sales order report to the docs
* Added more context variables on orders to the docs
* fixed small bug in doc report sample templates
(cherry picked from commit 7b994a3d07)
Co-authored-by: Michael <michael@buchmann.ruhr>
* Improve custom maintenance mode backend (#9396)
* Improve custom maintenance mode backend
- Utilizing global settings functions
- Will use global cache if available
- Fewer DB hits per request
* Twaeak query limits
* Tweak test
* [Bug] mport fix (#9008)
* Better handling of request object in serializers
* Pass request object through
- Required to extract user information
* Strip column header during import
- Prevent mismatch due to whitespace
* Fix for "minimum stock" field
* Fix for part serializer
* Extract default values on import
* Remove outdated migration message
* Bump API version
* Reintroduce typo
- To prevent API change
* Force label printing to background worker
* Refactor "check_reload" state of machine registry
- In line with plugin registry
- More work can be done here (i.e. session caching)
* Better handling of call_plugin_function
* Wrapper for calling machine function
* Use AttributeError instead
* Simplify function offloading
* Check plugin registry hash when reloading machine registry
* Cleanup
* Fixes
* Adjust unit test
* Cleanup
* Allow running in foreground if background worker not running
* Simplify call structure
- Getting flodded with reports of users misapplied template filters
(cherry picked from commit 017d96f64e)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* [Bug] Fix search for StockTrackingList
- Removed invalid field
* Add unit test coverage for failing condition
* Fix 'notes' field for extra line item API
(cherry picked from commit 21ae1138ce)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* use ref pattern on PO duplicate
* use ref patterns on duplicate for other types of orders
* revert unintentional change to pre-commit
* add playwright tests
---------
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
(cherry picked from commit 2cabd02c6b)
Co-authored-by: Jacob Felknor <jacobfelknor073@gmail.com>
* Fix logic for adding items to SalesOrder
* Same thing for purchase orders
* Update serializers.py
Revert typo fix
- Otherwise, we need to do an API bump and the PR can't be back-ported!
(cherry picked from commit bc9dbf7df4)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Fix default values for pricing override
* Fix broken calculation for sale pricing
- Was previously excluding COMPLETED orders
* Fix for PricingOverviewPanel
* Fix for InvenTreeMoneySerializer
- Numbers should be represented as numbers!
* Front-end wrangling too
* Fix unit test
- Prevent shadow overwrite of default_values dict
- Remove dead code
(cherry picked from commit 7049e84ac3)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Unit test for SalesOrder data migration
* make field checks more stable
* Adjust migration strategy
* Fix for data migration
* Simplify login test for playwright
---------
Co-authored-by: Matthias Mair <code@mjmair.com>
(cherry picked from commit a13f5681a1)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Docs updates:
- Fix error related to key access
- Fix rendering of settings tables
- Add setting key as mouseover text
* Revert config
(cherry picked from commit 640d5852e4)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Add option to disable auto-reload of dev server
* Force plugin reload
* Add unit testing for plugin reload
- Requires modifications to registry.py
(cherry picked from commit 8e8b7158b7)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Include location detail in build output table
* Raise validation error if trying to split an in-production item
(cherry picked from commit 68d3620bb2)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Exclude "tags" fields from data import
- May reintroduce at a later date
- Currently, no support for editing tags in frontend
* Refactor
(cherry picked from commit 2575c7276c)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Increase upload timeout for attachments
* Increase default API timeout
- To account for distant connections
* Use longer timeout when uploading files
* Debug for RTD testing
* Adjust commit extraction
* Cleanup debug output
* Include more vars in output
* Move debug output to top of file
* Add useful link
(cherry picked from commit c7e960728d)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Bug fix for PurchaseOrder
- Correctly record the user who created a PO
- Code refactoring
* Updated unit tests
(cherry picked from commit dcf0bb103e)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
- Allow for "cascade" installed items
- i.e. support multi-level installed items
(cherry picked from commit 94f7890a41)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* do not install with uv for now - fixes#8789#8742#8495#8494
* Ensure errors are raised if install / update fails
(cherry picked from commit d7939efaa9)
Co-authored-by: Matthias Mair <code@mjmair.com>
* basic mixin file
* Add basic check for model type support
* Enhanced documentation for Caddyfile
* Additional documentation around proxy server
* Remove code from other PR
(cherry picked from commit ecc1c937ed)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Remove use_x_forwarded_port setting
- As per the docs, this is ignored in favour of use_x_forwarded_host
- So, is not being used anyway
* Add note on x_forwarded_host option
* Add warning message if SITE_URL not provided
* Add support for SECURE_PROXY_SSL_HEADER
* Update configuration template file
* Update SITE_URL docs
* Remove line
* Re-add use_x_forwarded_port
* Docs tweak
* Improve wording
* Fix broken link
(cherry picked from commit 23e4f2f2a2)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Update FAQ
* Add links to FAQ
* Extra info
* Extend documentation for debug options
(cherry picked from commit b0ce67fcd7)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
- Default value was previously 'True'
- Documentation indicated that it was 'False'
- Value in config_template.yaml was 'False' (but commented out)
(cherry picked from commit d4ee8c53b2)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Fix REST registration endpoint (#8738)
* Re-add html account base
Fixes#8690
* fix base template
* override dj-rest-auth pattern to fix fixed token model reference
* pin req
* fix urls.py
* move definition out to separate file
* fix possible issues where email is not enabled but UI shows that registration is enabled
* fix import order
* fix token recovery
* make sure registration redirects
* fix name change
* fix import name
* adjust description
* cleanup
* bum api version
* add test for registration
* add test for registration requirements
* fix merge issues
* fix merge from https://github.com/inventree/InvenTree/pull/8724
* Refactor form fields
- Allow error message to be passed through via field definition
- Return error information to onFormError
* Fix debounce issue for text fields
* Fix for useForm hook
* Badge fix
- Fix badge rendering for SalesOrderShipment
* Cleanup unit test
(cherry picked from commit aabcf52cd2)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Extra null check in SettingList.tsx
* Null checks on error responses
(cherry picked from commit 378d69f0b3)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Add helper function for displaying API error message
* Provide feedback on image upload
* Update notification
(cherry picked from commit 1eaf3a4594)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Start documentation chapter for plugin tests
* Added env variables to the doc
* Fix style errors
* Further style bugs
* Reformat environment variables
* Reformat environment variables
* Add comments from wolflu05
* Add text to the intro
* Added first example the plugin unit test
* Addred line it function
* Typo
* Typo
* Typo
* API fixes for SupplierPart
- Move API filtering into SupplierPartFilter class
- Correct field annotation for detail view
* Add "in stock" and "no stock" badges to SupplierPart detail
* Update details
* Annotate 'on_order' quantity for SupplierPart
* Add "has_stock" filter to SupplierPart API
* Improve API query efficiency
* Add 'has_stock' filter to table
* Update <SupplierPartDetail>
* Bump API version
* New pic
* Marked external icon in picture
* Added a comment on database creation for unittest
* Update contributing.md
---------
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Increase query limit
* Add "quantity" field to ReturnOrderLineItem model
* Add 'quantity' to serializer
* Optionally split stock when returning from customer
* Update the line item when splitting
* PUI updates
* Bump API version
* Add unit test
* Allow transfer of items independent of status marker
* Update test
* Display errors in stock transsfer form
* Add option to set status when transferring stock
* Fix inStock check for stock actions
* Allow adjustment of status when counting stock item
* Allow status adjustment for other actions:
- Remove stock
- Add stock
* Revert error behavior
* Enhanced unit test
* Unit test fix
* Bump API version
* Fix for playwright test
- Added helper func
* Extend playwright tests for stock actions
* Set status when returning from customer
* Fix default customer for return order table
* Set status when receiving items against a ReturnOrder
* Bump max query time for currency endpoint
* Bump API version
* Add 'stocktake_before' and 'stocktake_after' filters for StockItem API
* Enable new filters for StockItemTable
* Update CUI table filters
* Add more date filter options for orders
* Add date filters to BuildList
* Update BuildOrderTable filters
* Add more order date filters
* Cleanup PurchaseOrderFilter code
* Implement more PUI table filters
* Add "Completion Date" column to PurchaseOrderTable
* Update ReturnOrderTable
* Add 'text' option for TableFilter
* filter state management
* Bump API version
* Sorting for table filters
* Add playwright tests for stock table filtering
* Playwright updates
- Add some helper functions for common operations
* Refactoring for Playwright tests
* add PO wildcard default setting
* Revert "add PO wildcard default setting"
This reverts commit 6cc577fa73.
* use custom format spec for "wildcard with default" reference pattern
* add wildcard with default to docs
* add test for wildcard with default
* Append plugins dir to pythonpath
* Error handling in plugin helpers
* Install plugin into "plugins" directory
* Use plugins dir when installing from plugins.txt
* Implement removal of plugin from plugins dir
* Remove the dist-info dirs too
* Cleanup
* Catch errors
* Specify plugin location for CI
* Remove plugins.txt support
* Improve regex for plugin matching
* Revert "Remove plugins.txt support"
This reverts commit 0278350351.
* Remove PLUGIN_ON_STARTUP support
* Better error catching for broken packages
* Cleanup
* Revert "Cleanup"
This reverts commit a40c85d47d.
* Improved exception handling for plugin loading
* More logging
* Revert uninstall behaviour
* Revert python path update
* Improve check for plugins file
* Revert check on startup
* Better management of plugins file
- Use file hash to determine if it should be reloaded
* Fix docstring
* Update unit tests
* revert gh env
* No cache
* Update src/backend/InvenTree/plugin/installer.py
Co-authored-by: Matthias Mair <code@mjmair.com>
* Use hashlib.file_digest
* Remove --no-cache-dir
* Revert "Use hashlib.file_digest"
This reverts commit bf84c8155e.
* Add note for future selves
---------
Co-authored-by: Matthias Mair <code@mjmair.com>
* fix refreshInstance type and remove return
* Add seperate refresh function with promise as return
---------
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Add empty context menu
- For tables without "row actions"
- Show an "empty" menu
- For UX consistency across all tables
* Fix for playwright tests
- Recent changes to the demo dataset...
* Fix typo
* Fix for "installed in" display
- Allow "details" field to be passed custom params
* Add extra debug to link checking
* API: fix for StockTrackingList entry
* Display links for stock items in tracking entry table
* Generate absolute links for item renderers
* Revert "Generate absolute links for item renderers"
This reverts commit 878fba91d0.
* Bump API version
* Add playwright tests
* Add <PageTitle /> component
* Use useEffect to override hard-coded value
* Ensure page titles are tracked across the site
* Adjust unit tests
* Playwright test updates
* Tweak tests
* Update InvenTreeTable.tsx
Revert unused change
* Add level indicators and path to stock location dropdown
* Add level indicators and path to part category dropdown
* Updated stock location string to include location path
* Fix PUI form test (set location)
---------
Co-authored-by: Matthias Mair <code@mjmair.com>
* remove unneeded AjaxView usage
* add schema
* bump schema version
* make schema more acurate
* exclude not found view
* make script also axept base api
* Add new backend filters for BuildLine API
* PUI: Better display of part allocations against build orders
* Add 'order_outstanding' filter to SalesOrderLineItem API
* Add new table showing outstanding SalesOrder allocations against a part
* Update playwright test
* Cleanup
* Bump API version
* Add more table columns
* Tweak UsedInTable
* Another table tweak
* Tweak playwright tests
* Add exception handler in tasks.py
- Catch UnexpectedExit
- Print clear message on the command that failed
- Re-throw exception
* Change c.run to run(c)
- Pass all invoke commands through the exception handler
* Add more info to version command
* Pretty colors
* Remove dummy error
* Improve invoke task output:
- Add colors for different message types
- Add success messages for critical tasks
* Tweaks
* Improve output commands
* Add example for INVENTREE_CUSTOMIZE environment variable
* Search also for IPN in allocated parts for build
* Changed example
* Added doc about external stock locations
* Migration for SalesOrderAllocation
- Allow allocation against order with null shipment
* Enhaced query efficiency
* Further API cleanup
* Adjust serializer
* PUI updates
* Enable editing of allocation shipment
* Improve shipment filtering
* Add sub-table for salesorderlineitem
* Add helper method to SalesOrder to return pending SalesOrderAllocations
* Fix for CUI
* Update form for CUI
* Prevent SalesOrder completion with incomplete allocations
* Fixes for StockItem API
* Frontend refactoring
* Code cleanup
* Annotate shipment information to SalesOrder API endpoint
* Update frontend PUI
* Additional filtering for SalesOrderAllocation
* Bump API version
* Hide panel based on user permissions
* js linting
* Unit test fix
* Update playwright tests
* Revert diff
* Disable playwright test (temporary)
* View output from build table
* remove coupling of tests to cui
* all testing for PUI absolute urls
* remove overlapping test
* refactor middleware check
* move static things into global
* factor out test target
* re-add api exception
* keep using settings.js for now
* Adjustments to default template file
- Do not specify SAMESITE_COOKIE options by default
- Fallback to the values in settings.py
* Update config_template.yaml
* Add "active" filter to PurchaseOrderLineItem.part field
* Fix for allocation serial numbers to incoming items
* Validate serial numbers per line item
* Improved permission checking for data importing
- Permission checks on the imported model type
* Improved validation for DateField
* Ignore MissingRate errors
- Do not send these to sentry
* Improved permission checking for data importing
- Permission checks on the imported model type
* Improved validation for DateField
* Fix for unit test
* Refactor plugin components into <RemoteComponent />
* Clean up footer
* Allow BuildOrder list to be sorted by 'outstanding'
* Fix model name
* Update BuildOrderTable filter
* Add StockItemTable column
* Working towards new dashboard
* Cleanup unused imports
* Updates: Now rendering some custom widgets
* Define icons for model types
* Add icon
* Cleanup / refactor / delete
- Complete transfer of files into new structure
* Follow link for query count widgets
* Add some more widgets to the library
* Remove old dashboard link in header
* Remove feedback widget
* Bump API version
* Remove test widget
* Rename "Home" -> "Dashboard"
* Add some more widgets
* Pass 'editable' property through to widgets
* Cleanup
* Add drawer for selecting new widgets
* Allow different layouts per user on the same machine
* Fixes
* Add ability to *remove* widgets
* Add helpful button
* Add a keyboard shortcut
* Refactoring
* Add backend code for serving custom dashboard items
* Load dashboard items from plugins
* Tweak for dashboard item API query
- Refetch if user changes
- Tweak "loaded" value
- Prevent refetchOnMount
* Add message if no dashboard widgets are displayed
* Refactoring main navigation menu
- Group into sections
- Cleanup / consolidation
- General refactoring
* Remove playground
* Add backend field for storing dashboard layout
* Add extra type definitions for UseInstance
* Manual labels for builtin dashboard items
- Otherwise they will change with translation locale
* Shorten labels for more plugins
* Adjust DashboardMenu
* Reduce stored data
* Add widget filter by text
* Remove back-end settings
* Update playwright tests for dashboard
* Updated tests
* Refactor backend API for fetching plugin features
* Further fixes for back-end code
* More back-end fixes
* Refactor frontend:
- Custom panels
- Custom dashboard items
* Further backend fixes
* Yet more backend fixes
- Improve error handling
* Fix for custom plugin settings rendering
* Enable plugin panels for part index and stock index pages
* Cleanup
* Fix nav menu
* Update typing
* Helper func to return all plugin settings as a dict
* Update API version date
* Fix for UseInstancea
* typing fix
* Tweak layout callbacks
* Pass query parameters through to navigation functions
* Improve custom query display
* Add "news" widget
* Ensure links are prepended with base URL on receipt
* Update NewsWidget
* Bug fix
* Refactor template editor tests
* Refactor unit testing for test_ui_panels
* Unit test for dashboard item API endpoint
* Update comment
* Adjust playwright tests
* More playwright fixes
* Hide barcode scanning options if disabled
* Tweak dashboard widget
* Fix custom panel title
* Update documentation around UIMixin class
* Cleanup
* Additional docs
* Add icon def for 'error' ModelType
* Add error boundary to TemplateEditor component
* Fix so that it works with template editors and previews again
* Tweak error messages
* API unit test fixes
* Unit test fix
* More unit test fixes
* Playwright test tweaks
* Adjust error messages
* Add "destination" field to PurchaseOrder
* Add 'destination' field to API
* Add location to PurchaseOrderDetail page
* Display "destination" on PurchaseOrderDetail page
* Pre-select location based on selected "destination"
* Fix order of reception priority
* Auto-expand the per-line destination field
* Add "Purchase Order" detail to StockItemDetail page
* Bug fix in PurchaseOrderForms
* Split playwright tests
* Docs updates
* Bump API version
* Unit test fixes
* Fix more tests
* Backport to CUI
* Use PurchaseOrder destination when scanning items
* Prevent multiple background workers without global cache
* Documentation updates
- New page dedicated to InvenTree process stack
- Update links
- Consolidate information
* Update mkdocs.yml
* Fix for create_child_builds
- Account for concurrency between multiple worker processes
- Ensure db commits are atomic
- Add random delays between build creation
* Check for existing build order
* Initially force task off to background worker
* Revert force_async change
* Include actual model name in notification repot
* Include model_id in API
* Refactoring for NotificationDrawer
- Add error boundary
- Separate rendering func for individual entry
- Allow router navigation
- Better link introspection
- Add tooltip for notification description
* Add URL support for errors
* Allow navigation to an individual error in the admin center
* Updates
* Add rendering method for 'error' model type
* Add helpers methods for table row expansion
* Render a simplified "line item sub table"
- Akin to CUI implementation
- But like, better...
* Edit / delete individual stock allocations
* Improvements for BuildLineTable and BuildOutputTable
* Improvements for table fields
* Refactoring
* Refactor BuildLineTable
- Calculate and cache filtered allocation values
* Code cleanup
* Further fixes and features
* Revert new serializer field
- Turns out not to be needed
* Add playwright tests
* Bug fix for CUI tables
- Ensure allocations are correctly filtered by output ID
* Adjust CUI table
* Revert change to BuildItem API
- Requires "allocations" for build output table
- Probably can refactor this later
* Bug fix for BuildOutputTable in PUI
- Correct calculation for "fully allocated"
* Adjust annotations for serializer
* Bump API version
* Remove 'allocations' from BuildLineSerializer
- Expensive to have a "many" serializer automatically used
- Adjust existing tables accordingly
- Fetch on demand
* WIP: Add some unit tests
* Adjust BuildLine queryset annotation
- Multi-level annotation proves to be very expensive
- Reduce complexity, save a bunch of time on queries
- Remove 'total_allocated_stock' field
- Adjust API query filter
* Optimize query by deferring certain fields
* Further query refinements
* Bump API version
* Enforce lower case for model name checks
* Enhance settings validation
- Add support for "float" settings type
- Improve validation code and error handling
* Add 'group' to offload_task
- Make use of 'group' field in AsyncTask model
- Allows better db filtering
* Log error if low_stock check cannot be performed
* Ensure low-stock checks are performed by the background worker
* Change encoding of arguments to 'notify_low_stock_if_required'
- Pass part ID, not part instance
- Safer, but requires DB hit
* Fix typo
* Fix to allow tests to run
* Fix 'allocated' queryset annotation for SalesOrderLineItemSerializer
* Add 'allocated' filter for SalesOrderLineItemList
* Allow ordering by 'allocated' and 'shipped' values
* Updated unit testing
* Bump API version
* Update playwright tests
* Add "IPN" column to build order allocated stock table
* Allow sorting and searching by IPN
* Handle allocations where allocated but required == 0
* Add "no info available" message to part scheduling
* Adjust PartSchedulingTable
* Icon fix
* Add "latest serial number" information to PartDetail page
* Cleanup code for serial-number placeholder in forms
* Logic fix for displaying non-unity pack quantity
* Fix description field on SupplierPart page
* Fix duplicate table column
* Create simply PartSalesPanel component
* Updates
* Add API endpoint for SalesHistory
- And serializers
- Basic, needs lots of work still
* Fix for PartDetail page
* SalesOrder page updates
* More page updates
* Update API endpoint
* Backend improvements
* add API endpoint
* Front-end rendering
* Make frontend generic
* Fix for CompanyTable
* Make back-end API more generic
* More API improvements
* Implement history for purchasing
* API / UI fixes
* Remove debug statements
* Support file download
* Add endpoint for build order history
* Implement UI for build order history
* Revert backend
* Revert frontend
* Remove unsed imports
* Cleanup permission checks
* Bump API version
* Improve token management code
- Do not request token if other cookies are unavailable
- Do not fetch user data if token is unavailable
- Prevents connection error logs
* Fix for CompanyTable - onRowClick
* Error handling for plugin.increment_serial_number
* Improve error handling for plugin validation functions
* Add Part.get_next_serial_number method
- Simplify call for incrementing
* ValidationMixin: add "part" to increment_serial_number func
* Pass part information through to serial number functions
* Fix circular imports
* Allow "get_latest_serial_number" to use plugin system
* Better working example for plugin sample
* Update SampleValidatorPlugin
* Fix indent
* Add code comment
* Cleanup code logic
* Revert previous commit
* Update unit tests
* BuildOrderTable: Show variants
- Allow filtering of build orders by part variant
* Add "include_variants" filter for SalesOrder table
- A bit tricker!
* Add "include_variants" filter to PartPurchaseOrdersTable
* Enable filtering ReturnOrder by "part" attribute
* Add similiar functionality for SalesOrderAllocation
* Add similar filter for BuildAllocation table
* Add migration file
* Add "index" page for build orders
- Make consistent with other pages
- Allow plugin panels here
- Prepare for future development
* Rearrange URLs for "manufacturing"
- Provide same format as other order types
- Allow for other sub-pages under "manufacturing" in the future
* Fix breadcrumbs
* Adjust playwright tests
* Pass more information through in redirect after login
- Include query parameters in redirect
* InvenTreeTable: Update filters based on URL query parameters
* Add button to remove custom URL query filters
* Refactor "update_serial_number" method
* Refactor serial number validation
- Query is much more efficient now
- Does not have to check each serial number individually
- Makes use of existing Part class method
* Refactor creation of multiple stock items
* Fix for singular item creation
* Refactor serializeStock method:
- Push "rebuild tree" to background worker
- Use bulk_create actions
* Refactor createion of serialized build outputs
* Prevent 1+N DB hits
* Cleanup
* Cleanup
* Reinstate serial number checks
* Add limit for serial number extraction
* Fix cache config
* Revert cache settings
* Fix for unit tests
* Playwright tests
* Bug fix
* Force False cookie mode in testing
* Revert aria-label for PanelGroup items
- No longer works as expected with playwright locators
* Fix playwright vtest
* Further updates
* Playwright test adjustments
* Remove duplicate locator
* Add "in_stock" attribute to StockItem API
* Add "unavailable" badge to StockDetail page
* Hide stock actions menu for "unavailable" stock
* Fix renderer for StockItemTable
* refactor stock table display
* Add 'date' type details field
* Disable "expiry" information on StockDetailPage
* Icon fix
* Bump API version
* Refactor AttachmentPanel into common component
* Remove unused imports
* Add very basic implementation for SalesOrderShipmentDetail page
* Refactor NotesPanel into common component
* Fetch customer data
* Add some placeholder actions
* Updates for shipment detail page
* Adjust SalesOrderShipment API
* Add badges
* Implement API filter for SalesOrderAllocation
* Display allocation table on shipment page
* Add placeholder action to edit allocations
* Improvements for SalesOrderAllocationTable
* Improve API db fetch efficiency
* Edit / delete pending allocations
* Fix for legacy CUI tables
* API tweaks
* Revert custom attachment code for SalesOrderShipment
* Implement "complete shipment" form
* Allocate stock item(s) to sales order
* Fixes for TableField rendering
* Reset sourceLocation when form opens
* Updated playwrigh tests
* Tweak branch (will be reverted)
* Revert github workflow
* Adjust samesite cookie behaviour:
- In DEBUG mode, turn off entirely
- Allow False value (note: *not* a string)
- Force insecure cookie in DEBUG mode
* Change default value in config file template
* Update docs
* Adjust COOKIE_SECURE based on SAMESITE setting
* Translation fixes
- Simplifies translations strings
- Removes some similar duplicate strings
- Reduces passing of tokens into translation
* Adds script for detecting close matches in translation source strings
* Updates for custom script
* Detect duplicate strings (ignoring case)
* Fix some duplicate backend strings
* Fix duplicate strings in frontend
* Fix more duplicate strings
* Run check_source_strings in CI
* Fixes for unit tests
* Fix another broken string
* Revert some changes
* Fix f-string
* Fix old migration files
* Reduce front-end duplication
* Further updates
* Revert change
* Updates
* Refactor serial number allocation
* Refactor API query
Note: This should be further improved, not to automatically return *all* allocation data
* Push expensive operations off to background worker
* Bump API version
* add more admin testing
* fix assertations
* add test for importer admin
* Add tests for https://github.com/inventree/InvenTree/pull/7164
* add common/attachment test
* fix test
* add tests
* remove unused definition - the view is read only
* Revert "remove unused definition - the view is read only"
This reverts commit 4cad8d16f3.
* more tests in report
* Update tests.py
* make lookup dynamic
* make report assertation dynamic
* add migration test
* extend validation plugin tests
* disable flaky test
* Add test for barcode/uid transition
* test reverse migration
* cleanup new test
* remove empty action
* split and refactor API tests
* refactor test
* Add test for error conditions
* fix double entry
* more migration tests
* also test no history
* fix assertation
* add another migration test
* fix typo
* fix manufacturer filter
* test more filters
* even more filter tests
* move top level test to right place
* add todos for tests that could be more expressive
* add test for checking duplicate serials
* ignore cautious catches
* Add helper function for constructing URL to static file
* Fix PluginListTable
- Allow uninstallation of plugin
- Allow deletion of plugin config
* Move helper method to InvenTreePlugin class
* Bump API version info
* Handle simple string error message
* Add playwright test for form validation
* Render stock unit price / total value
* Fix for TextField:
- Prevent unnecessary value change
- This was removing the field error
* Add playwright test for supplier form validation
* Improve checks if "installed items" panel should be displayed
* Adds ability to exclude a given field from form data
* Implement form for installing stock item
* Add placeholder for uninstall action
* Add "note" field
* Add PUI form to uninstall stock item
* Add PUI form to serialize existing stock item
* Remove debug statement
* Ensure that stock item trees are rebuilt correctly after serialization
- No idea how this has not been detected previously
* Add unit test to ensure child_items annotation works as expected
* Add link to parent item in stock detail page
* Refactor to use new placeholder hook
* Enhancements for stock item form
* Edit stock item from "build output" table
* Rearrange menu items
* Fix build order line complete action
* Fix for other modals
* Cleanup dead code
* Reload build details after output state change
* Logic fix for plugin table
* Bump API version
* Adds hook for generating placeholder serial numbers
* Add playwright tests
* Remove unused imports
* Cleanup playwright tests
* Add server-side context for panel plugin rendering
* Add "context" to PluginContext type
* Pass server context through to client-side rendering
* Bump API version
* initial implementation to let plugins provide custom ui features
* provide exportable types
* refactor ref into renderContext to make it more generic and support template preview area ui plugins
* rename 'renderContext' -> 'featureContext' as not all features may render something
* allow to specify the function name via the source file string divided by a colon
* Bump api version
* add tests
* add docs
* add docs
* debug: workflow
* debug: workflow
* fix tests
* fix tests hopefully
* apply suggestions from codereview
* trigger: ci
* Prove that coverage does not work
* Revert "Prove that coverage does not work"
This reverts commit 920c58ea6f.
* potentially fix test???
* Refactor "stocktake" chart
- Format date axis correctly
- Better tooltips
* Fix datatable queries
- Prevent potential infinite loop
* Fix tooltip for BOM table
- Bug due to '.' char in names
* Do not reassign parameter
* Another fix
* Check global config value
* Cleanup tooltip for BOM pie
* Edit and refresh pricing from panel
* Placeholder part scheduling panel
* Add API endpoint definition
* Add defined serializer to scheduling endpoint
* Refactor add_schedule_entry
* Fix field type
* API tweak
* Render scheduling data
* Make links clickable
* Correctly account for dates in the past
* Cleanup table
* Bump API version information
* js linting
* Add model for recording barcode scan results
* Add "admin" interface for new model
* Add API endpoints for barcode scan history
* Add global setting to control barcode result save
* Add frontend API endpoint
* Add PUI table in "admin center"
* Add API filter class
* Enable table filtering
* Update model definition
* Allow more characters for barcode log
* Log results to server
* Add setting to control how long results are stored
* Table updates
* Add background task to delete old barcode scans
* Add detail drawer for barcode scan
* Log messages for BarcodePOReceive
* Add warning message if barcode logging is not enabled
* Add "context" data to BarcodeScanResult
* Display context data (if available)
* Add context data when scanning
* Simplify / refactor BarcodeSOAllocate
* Refactor BarcodePOAllocate
* Limit the number of saved scans
* Improve error message display in PUI
* Simplify barcode logging
* Improve table
* Updates
* Settings page fix
* Fix panel tooltips
* Adjust table
* Add "result" field
* Refactor calls to "log_scan"
* Display result in PUI table
* Updates
* Fix typo
* Update unit test
* Improve exception handling
* Unit test updates
* Enhanced unit test
* Ensure all database key config values are upper case
* Refactor some playwright helpers
* Adds playwright test for barcode scan history table
* Requires some timeout
* Add docs
* Refactor API endpoint for duplicating line items from a purchase order
- Previously was "hidden" (undocumented)
- Cleanup / refactor code
- Now matches part duplication options
- Generic implementation supports all order types
* Update forms
* Refactor line item duplication
* Implement front-end support for return orders
* Enable duplication of sales orders from PUI
* Bump API version
* Adds basic API endpoint for requesting plugin panels
* Split PanelType out into own file
* Placeholder for a plugin panel loaded dynamically
* Add some dummy data for the plugin panels
* Example of plugin panel selection based on page
* Expose some global window attributes
* Add new setting
* Disable panel return if plugin integration is not enabled
* Update hook to auto-magically load plugin panels
* Allow custom panel integration for more panel groups
* Remove debug call
* Tweak query return data
* async fn
* Adds <PluginPanel> component for handling panel render
* Cleanup
* Prevent API requests before instance ID is known
* Pass instance data through
* Framework for a sample plugin which implements custom panels
* offload custom panels to sample plugin
* Load raw HTML content
* Expand custom panel rendering demo
* Adjust API endpoints
* Add function to clear out static files which do not match installed plugin(s)
* Update static files when installing plugins from file
* Update static files when installing or uninstalling a plugin
* Update static files on config change
* Pass more information through to plugin panels
* Prepend hostname to plugin source
* Pass instance detail through
* Cleanup code for passing data through to plugin panels
- Define interface type
- Shorten variable names
* Update docs requirements
* Revert "Update docs requirements"
This reverts commit 63a06d97f5.
* Add placeholder for documentation
* Fix imports
* Add a broken panel which tries to load a non-existent javascript file
* Render error message if plugin does not load correctly
* Only allow superuser to perform plugin actions
* Code cleanup
* Add "dynamic" contnt - javascript file - to example plugin
* Remove default values
* Cleanup unused code
* PanelGroup updates
* Cleanup hooks for changing panel state
* More work needed...
* Code cleanup
* More updates / refactoring
- Allow dynamic hiding of a particular panel
- Pass target ref as positional argument
- Better handling of async calls
* Documentation
* Bump API version
* Provide theme object to plugin context
* Adjust sample plugin
* Docs updates
* Fix includefile call in docs
* Improve type annotation
* Cleanup
* Enable plugin panels for "purchasing index" and "sales index" pages
* Fix for plugin query check
* Improvements to panel selection
- Code refactor / cleanup
- Ensure that a valid panel is always displayed
- Allow plugin panels to persist, even after reload
* Playwright test fixes
* Update src/frontend/src/hooks/UsePluginPanels.tsx
Co-authored-by: Lukas <76838159+wolflu05@users.noreply.github.com>
* Update src/frontend/src/components/plugins/PluginPanel.tsx
Co-authored-by: Lukas <76838159+wolflu05@users.noreply.github.com>
* Update src/frontend/src/components/plugins/PluginContext.tsx
Co-authored-by: Lukas <76838159+wolflu05@users.noreply.github.com>
* Fix context
* Add more context data
* Docs updates
* Reimplement local state
* Fix mkdocs.yml
* Expose 'colorScheme' to plugin context
* Define CustomPanel type definition
* Add unit testing for user interface plugins
* Add front-end tests for plugin panels
* Add new setting to plugin_settings_keys
* Adds helper function for annotating build line allocations
* Improve query efficiency
- Especially around unit testing
- Ensure all settings are generated
- Do not auto-create settings during registry load
* Improve query efficiency for build order operations
* Reduce max query count for specific test
* Revert query count limit
* playwright test updates
---------
Co-authored-by: Lukas <76838159+wolflu05@users.noreply.github.com>
* Simplify user theme settings
* Cleanup
* Fix permission on user list endpoint
* Update AccountDetailPanel to use modal form
* Update components
* UI updates
* Implement default colors
* Display more user details (read only)
* Add specific "MeUserSerializer"
- Prevent certain attributes from being adjusted
* Add <YesNoUndefinedButton>
* Allow role checks to be bypassed for a given view
- Override the 'get_permission_model' attribute with None
* Enable 'GET' metadata
- Required for extracting field information even if we only have 'read' permissions
- e.g. getting table columns for users without write perms
- use 'GET' action when reading table cols
* Add info on new user account
* Fix boolean expression wrapper
* Ruff fixes
* Adjust icon
* Update unit test
* Bummp API version
* Table layout fix
* Add API endpoint for all defined units
Fixes#7858
* render all units in API
* bump API
* Add display for all units
* remove logging
* fix types
* ignore favicon errors
* fix for new pint version
* add tests
* prove against units that are not defined
* append trailing slash to url
* make pagination disableable again
* Improve logic for automatically updating part pricing
* Simplify logic
* Update unit tests to ensure pricing flows upwards
* Unit test update
* Add unit tests for handling of "multi level" BOM pricing
* ADjust unit tests
* Improve efficiency of operation
* Adjust testing for pricing
- Only allow pricing updates in testing if TESTING_PRICING flag is set
* Tweak when pricing updates are performed
* More tweaks
* Fix dynamic translation of ModelType labels
- Cannot be stored as a const, as the locale changes dynamically
- Return translated labels via lookup function
* Tweak inline rendering functions
* Remove references to old setting
- Now offloaded to plugins
* Remove REPORT_ENABLE_TEST_REPORT setting
* Cleanup
* Add new boolean setting to control whether reports are attached automatically
* Attach generated report to model instance
* Update unit testing
* Bump API version
* [PUI] Add placeholder action
- "Allocate Serials" action for sales order
- No functionality yet
* Implement form for allocating by serial numbers
* Improve validation of serial numbers in back-end
* Trim serial number string
* Namespaces for invoke tasks
Fixes#7852
* adjust various places that call re-namespaced tasks
* use full invoke command
easier for future refactors
* fix call name
* move worker to int
* adapt calls in tasks
* fix changed path
* ignore localhost links
* Avoid using internal names
* Support for thematic breaks
- Use the '-' character
* Improve "read only" mode
* Refactor markdown notes editor
- Revert back to simplemde
- Remove package dependencies for mdxeditor
- Fix up buttons / preview / save sequencing
* Update playwright tests
* Cleanup toolbar buttons
* Enable "side by side" mode
* Update UI text
* Make dropdowns better recogniseable
Closes https://github.com/invenhost/InvenTree/issues/98
* change to button with section
* only draw border if needed
* allign drowdowns in header
* use light instead of subtle
* refactor option dropdowns to reduce duplications
* add test for asset redirect
* fully cover spa_bundler
* test token api
* check without beeing authed
* not possible to be reached - no cover
* remove unneeded except
* fully test group apis
* move ignore
* add tests for admin site
* add full admin testing
* use output as ref
* ignore admin edge-case
* test display name settings
* refactor admin test
* add more admin testing
* fix tests assertation
* fix assertations
* add test for importer admin
* remove old test for function that will not be re-added for now
see https://github.com/inventree/InvenTree/pull/8018#discussion_r1734011050
* Add stock detail with wrong pk
* add a few stock tests
* Fix restriction for PartTestTemplate
- limit_choices_to should be "testable", not "trackable"
- ref: https://github.com/inventree/InvenTree/pull/7888
* Add migration file
* Fix validation check
* Fix API filter
* Fix for test fixture
* Fix another test
* Fixture data
* Fix comment
* More fixes
* More fixes
* Moar fix plz thx
* Add Link/Unlink Barcode action
Fixes#7920
* remove unneeded imports
* remove duplication
* simplify
* add testing
* refactor type
* wait for reload to add coverage
* Add warning if custom barcode is used
* Add Image based assign
* fix action button size
* fix selection to prevent wrapping
* use left section for button
* Refactor to seperate Input
* Add comment when not scanning
* Fix punctuation
* factor scan area out
* fix readonly arg
* make BarcodeInput more generic
* make button optional
* reduce code duplication by using BarcodeInput
* remove unneeded abstraction
* add table buttons to build line table
* Add deallocate row action
* Restrict row actions
* Add functionality to 'deallocate' stock from build order
* Implement 'auto-allocate'
* Table column cleanup
* Refactor code into new hook:
- Helper function to update a set of selected rows
- Callback function to remove row
* Refactor existing forms to use new hook
* Fix for RelatedModelField
- Handle callback for null value
* Memoize each field instance
* Cleanup dead code
* Define interfac for TableField row properties
* Handle processing of nested errors
* Pass form controller through to table field rows
* Pass row errors through to individual table rows
* Allow Standalone field to render errors
* Allow allocation against build lines
* Adjust quantity value when stock item is changed
* Fix issue related to field name
* Add "available" filter
* Add "remove row" button
* Add field for selecting source location
* Filter out consumable items
* Adjust form success message
* Revert changes from https://github.com/inventree/InvenTree/pull/7965
* Add error handling for wrong key
* Add e2e test case for error condition
Fixes#7964
* Better code code / flow
* [BUG] Order of states in schema descriptions is not stable
Fixes#7977
* Prevent template adjustment
* Prevent template from being edited
* Fix 'attachment' field for StockItemTestResultSerializer
- Allow 'null' value
* Bump API version
* Add custom user defined states
* make tests more reliable
* fix list options
* Adapt version
* do not engage if rebuilding
* remove unneeded attr
* remove unneeded attr
* fix enum imports
* adapt cove target
* Add status_custom_key to all other serializers
* fix serializer method
* simplify branching
* remove unneeded imports
* inherit read_only status from leader field
* Add more tests
* fix tests
* add test for function
* refactor for easier testing
* move test to seperate class
* Add options testing
* extend serializer
* add test for all states and refactor to reuse already build functions
* use custom field in PUI too
* reset diff
* style fix
* fix comparison
* Add test for str
* test color exceptions too
* remove user state from tracking
* Add intro from model fields too
* update docs
* simplify implementation
* update tests
* fix name
* rename test
* simplify tags and test fully
* extend test to machine status
* move logic for response formatting over
* extend api response with machine status
* ensure only direct subclasses are discovered
* test for length of total respone too
* use new fields on PUI too
* fix test assertion with plugins enabled
* also observe rendering in filters
* Add managment endpoints and APIs
* Add contenttypes to PUI renderes
* use filteres instead
* fix import order
* fix api route definition
* move status choices to serializer
* fix lookup
* fix filtering
* remove admin integration
* cleanup migration
* fix migration change
* cleanup code location
* fix imports
* Add docs for custom states
* add links to custom status
* Add "create_child_builds" field to BuildOrder serializer
- only when creating a new order
- write only field
* Update serializer field
* Add placeholder task for creating child build orders
* Add field to PUI forms
* Auto-create build orders as required
* Bump API vresion
* Add documentation
* Update unit tests
* Update function signature for 'validate_serial_number'
- Pass through stock item parameter
- Required if we want to exclude a particular item from that test
* Update documentation
* Docs fixes
* Add type annotations
* updated translation base
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* updated translation base
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Remove default "not yet implemented" action
- Will force us to manually add "not yet implemented"
- Intended to highlight where we still need to work
* Refactor more components
* Fix for onClick
* Add API bump
* [PUI] Add theme setting to navbar
Closes https://github.com/invenhost/InvenTree/issues/106
* Rename to the same as ColorToggle
* Change action text
Co-authored-by: @SchrodingersGat
* updated translation base
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Add "testable" field to the Part model
- Default = False
- Determines whether a particular part can have tests defined against it
* Adds data migration to set default 'testable' state
* Update part serializers
* CUI: Update table filters
* PUI: Update tables and filters
* CUI: Update part detail page
* PUI: Update part detail page
* Update CUI
* Update build pages
* Update BuildLine serializer
* Bump API version
* Update docs
* Add 'testable' to fieldset
* updated translation base
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Add helper func to check user permission against a given model type
* Validate bulk delete of attachments
- Check permissions against linked model type(s)
* Check permission when creating or editing an attachment instance
* Fix typo
* Fix AttachmentSerializer to allow editing
* Update unit tests accordingly
* Remove unused custom permission classs
* Bump API version
* updated translation base
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* adapt namespace
* add new labels
* make baseimage available for labels
* remove unneeded ending
* ensure image name is correct for ghcrio
* ensure the right outputs are used
* fix reference
* fix assigment
* only push docker reg image if authd
* swith back to env
this gets provided by the version ci script
* make repo targets changeable
* make readable
* revert ghcr.io change
* updated translation base
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Add new global setting
* Check if there are open children before completing a build
* Adds management command to export settings definition
* Fix settings export
* Extract settings data into documentation
* Add global settings spec
* User settings
* Revert strict mode
* Tweak unit test
* Remove unreachable code
* Always export settings first
* Remove unused macro
* Remove old images
* Re-add missing docs strings
* Tweak docs
* Remove unused import
* Create build order from sales order table
* Allow creation of child build order from build page
* Add production and purcahse order quantitres to sales order item serializer
* Bump API version
* Fix playwright test
* Check user permission for tables
* Update permissions for user table
* Fix permission checks for group table
* Permission check for group detail
* Add divider
* Fix permission for template tables
* updated translation base
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Add "ON_HOLD" status code for orders
* Add placeholder buttons for purchase order status change
* Adds hooks for introspecting status code enumerations
* Refactor status codes for import session
- Remove hard-coded values
* Refactor into <PrimaryActionButton />
* Cleanup
* more permission checks
* Add placeholder actions for SalesOrder
* Placeholder actions for ReturnOrder
* Placeholder actions for build order
* Actions for "return order"
* Update actions for return order
- Add "on hold" transition
* Implement transitions for SalesOrder
* Allow control over SalesOrderLineItemTable
* Implement PurchaseOrder actions
* Improve API query lookup efficiency
* UI cleanup
* CUI cleanup
* Build Order Updates
- Implement StateTransitionMixin for BuildOrder model
- Add BuildIssue API endpoint
- Add BuildHold API endpoint
- API query improvements
- PUI actions
* Increase timeout
* Bump API version
* Fix API version
* Fix sales order actions
* Update src/backend/InvenTree/order/serializers.py
Co-authored-by: Matthias Mair <code@mjmair.com>
* Adjust build filters
* PUI updates
* CUI refactoring for purchase orders
* Refactor CUI sales order page
* Refactor for return order
* Refactor CUI build page
* Playwright tests for build order
* Add playwright test for sales orders
* Add playwright test for purchase orders
* js linting
* Refactor return order page
* Add missing functions from previous commit
* Fix for "on order" badge on PartDetail page
* UI tweaks
* Fix unit tests
* Update version check script
* Fix typo
* Enforce integer conversion for BaseEnum class
* Unit test updates
- Includes improvement for equality comparison for enums
* Update documentation
---------
Co-authored-by: Matthias Mair <code@mjmair.com>
[](https://opensource.org/licenses/MIT)
[](https://opensource.org/license/MIT)
[](https://bestpractices.coreinfrastructure.org/projects/7179)
# Detect if there is already a python version installed in /opt/inventree/env/lib
iftest -f "${APP_HOME}/env/bin/python";then
echo"# Python environment already present"
echo"# POI07| Python environment already present"
# Extract earliest python version initialised from /opt/inventree/env/lib
SETUP_PYTHON=$(ls -1 ${APP_HOME}/env/bin/python* | sort | head -n 1)
echo"# Found earlier used version: ${SETUP_PYTHON}"
echo"# POI07| Found earlier used version: ${SETUP_PYTHON}"
else
echo"# No python environment found - using environment variable: ${SETUP_PYTHON}"
echo"# POI07| No python environment found - using environment variable: ${SETUP_PYTHON}"
fi
# Try to detect a python between 3.9 and 3.12 in reverse order
if[ -z "$(which ${SETUP_PYTHON})"];then
echo"# Trying to detecting python3.${PYTHON_FROM} to python3.${PYTHON_TO} - using newest version"
echo"# POI07| Trying to detecting python3.${PYTHON_FROM} to python3.${PYTHON_TO} - using newest version"
for i in $(seq $PYTHON_TO -1 $PYTHON_FROM);do
echo"# Checking for python3.${i}"
echo"# POI07| Checking for python3.${i}"
if[ -n "$(which python3.${i})"];then
SETUP_PYTHON="python3.${i}"
echo"# Found python3.${i} installed - using for setup ${SETUP_PYTHON}"
echo"# POI07| Found python3.${i} installed - using for setup ${SETUP_PYTHON}"
break
fi
done
@@ -75,12 +77,14 @@ function detect_python() {
# Ensure python can be executed - abort if not
if[ -z "$(which ${SETUP_PYTHON})"];then
echo"${On_Red}"
echo"# Python ${SETUP_PYTHON} not found - aborting!"
echo"# Please ensure python can be executed with the command '$SETUP_PYTHON' by the current user '$USER'."
echo"# If you are using a different python version, please set the environment variable SETUP_PYTHON to the correct command - eg. 'python3.10'."
echo"# POI07| Python ${SETUP_PYTHON} not found - aborting!"
echo"# POI07| Please ensure python can be executed with the command '$SETUP_PYTHON' by the current user '$USER'."
echo"# POI07| If you are using a different python version, please set the environment variable SETUP_PYTHON to the correct command - eg. 'python3.10'."
echo"${Color_Off}"
exit1
fi
echo"# POI07| Using python command: ${SETUP_PYTHON}"
echo"# No setting for ${name} found - please set it manually either in ${INVENTREE_CONFIG_FILE} under '${config_key}' or with 'inventree config:set ${env_key}=value'"
echo"# POI08| No setting for ${name} found - please set it manually either in ${INVENTREE_CONFIG_FILE} under '${config_key}' or with 'inventree config:set ${env_key}=value'"
ABORT=true
else
echo"# Found setting for ${name} - ${value}"
echo"# POI08| Found setting for ${name} - ${value}"
fi
}
# Custom checks if old version is below 0.8.0
if["${old_version_rev}" -lt "9"];then
echo"# Old version is below 0.9.0 - You might be missing some configs"
echo"# POI08| Old version is below 0.9.0 - You might be missing some configs"
# Check for BACKUP_DIR and SITE_URL in INVENTREE_CONF_DATA and config
@@ -22,10 +22,10 @@ The API is self-documenting, and the documentation is provided alongside any Inv
### Generating Schema File
If you want to generate the API schema file yourself (for example to use with an external client, use the `invoke schema` command. Run with the `-help` command to see available options.
If you want to generate the API schema file yourself (for example to use with an external client, use the `invoke dev.schema` command. Run with the `-help` command to see available options.
@@ -66,10 +66,11 @@ Each *Build Order* has an associated *Status* flag, which indicates the state of
| Status | Description |
| ----------- | ----------- |
| `Pending` | Build has been created and build is ready for subpart allocation |
| `Production` | One or more build outputs have been created for this build |
| `Cancelled` | Build has been cancelled |
| `Completed` | Build has been completed |
| `Pending` | Build order has been created, but is not yet in production |
| `Production` | Build order is currently in production |
| `On Hold` | Build order has been placed on hold, but is still active |
| `Cancelled` | Build order has been cancelled |
| `Completed` | Build order has been completed |
**Source Code**
@@ -220,6 +221,10 @@ To create a build order for your part, you have two options:
Fill-out the form as required, then click the "Submit" button to create the build.
### Create Child Builds
When creating a new build order, you have the option to automatically generate build orders for any subassembly parts. This can be useful to create a complete tree of build orders for a complex assembly. *However*, it must be noted that any build orders created for subassemblies will use the default BOM quantity for that part. Any child build orders created in this manner must be manually reviewed, to ensure that the correct quantity is being built as per your production requirements.
## Complete Build Order
To complete a build, click on <span class='fas fa-tools'></span> icon on the build detail page, the `Complete Build` form will be displayed.
@@ -264,18 +269,16 @@ Build orders may (optionally) have a target complete date specified. If this dat
- Builds can be filtered by overdue status in the build list
- Overdue builds will be displayed on the home page
## Build Order Restrictions
## Build Order Settings
There are a number of optional restrictions which can be applied to build orders, which may be enabled or disabled in the system settings:
The following [global settings](../settings/global.md) are available for adjusting the behavior of build orders:
### Require Active Part
If this option is enabled, build orders can only be created for parts which are marked as [Active](../part/part.md#active-parts).
### Require Locked Part
If this option is enabled, build orders can only be created for parts which are marked as [Locked](../part/part.md#locked-parts).
### Require Valid BOM
If this option is enabled, build orders can only be created for parts which have a valid [Bill of Materials](./bom.md) defined.
Several models within InvenTree support the use of custom states. The custom states are display only - the business logic is not affected by the state.
States can be added in the Admin Center under the "Custom States" section. Each state has a name, label and a color that are used to display the state in the user interface. Changes to these settings will only be reflected in the user interface after a full reload of the interface.
States need to be assigned to a model, state (for example status on a StockItem) and a logical key - that will be used for business logic. These 3 values combined need to be unique throughout the system.
Custom states can be used in the following models:
| noaccess | youshallnotpass | No | Yes | Can login, but has no permissions |
| allaccess | nolimits | No | Yes | View / create / edit all pages and items |
| reader | readonly | No | Yes | Can view all pages but cannot create, edit or delete database records |
| engineer | partsonly | No | Yes | Can manage parts, view stock, but no access to purchase orders or sales orders |
| steven | wizardstaff | Yes | Yes | Staff account, can access some admin sections |
| ian | inactive | No | No | Inactive account, cannot log in |
| susan | inactive | No | No | Inactive account, cannot log in |
| admin | inventree | Yes | Yes | Superuser account, can access all parts of the system |
### Dataset
The demo instance is populated with a sample dataset, which is reset every 24 hours.
The source data used in the demo instance can be found on our [GitHub page](https://github.com/inventree/demo-dataset).
### Local Setup
If you wish to install the demo dataset locally (for initial testing), you can run the following command (via [invoke](./start/invoke.md)):
```bash
invoke dev.setup-test -i
```
*(Note: The command above may be slightly different if you are running in docker.)*
This will install the demo dataset into your local InvenTree instance.
!!! warning "Warning"
This command will **delete all existing data** in your InvenTree instance! It is not intended to be used on a production system, or loaded into an existing dataset.
### Clear Data
To clear demo data from your instance, and start afresh with a clean database, you can run the following command (via [invoke](./start/invoke.md)):
```bash
invoke dev.delete-data
```
!!! warning "Warning"
This command will **delete all existing data** in your InvenTree instance, including any data that you have added yourself.
Read the [InvenTree setup documentation](../start/intro.md) for a complete installation reference guide.
!!! note "Required Packages"
Depending on your system, you may need to install additional software packages as required.
### Setup Devtools
Run the following command to set up all toolsets for development.
```bash
invoke setup-dev
invoke dev.setup-dev
```
*We recommend you run this command before starting to contribute. This will install and set up `pre-commit` to run some checks before each commit and help reduce errors.*
## Branches and Versioning
InvenTree roughly follow the [GitLab flow](https://docs.gitlab.com/ee/topics/gitlab_flow.html) branching style, to allow simple management of multiple tagged releases, short-lived branches, and development on the main branch.
InvenTree roughly follow the [GitLab flow](https://about.gitlab.com/topics/version-control/what-are-gitlab-flow-best-practices/) branching style, to allow simple management of multiple tagged releases, short-lived branches, and development on the main branch.
There are nominally 5 active branches:
-`master` - The main development branch
@@ -169,21 +172,35 @@ The various github actions can be found in the `./github/workflows` directory
### Run tests locally
To run test locally, use:
```
invoke test
invoke dev.test
```
To run only partial tests, for example for a module use:
```
invoke test --runtest order
invoke dev.test --runtest order
```
To see all the available options:
```
invoke test --help
invoke dev.test --help
```
#### Database Permission Issues
For local testing django creates a test database and removes it after testing. If you encounter permission issues while running unit test, ensure that your database user has permission to create new databases.
For example, in PostgreSQL, run:
```
alter user myuser createdb;
```
!!! info "Devcontainer"
The default database container which is provided in the devcontainer is already setup with the required permissions
## Code Style
Code style is automatically checked as part of the project's CI pipeline on GitHub. This means that any pull requests which do not conform to the style guidelines will fail CI checks.
@@ -52,7 +52,7 @@ Tasks can help you executing scripts. You can run them by open the command panel
#### Setup demo dataset
If you need some demo test-data, run the `setup-test` task. This will import an `admin` user with the password `inventree`. For more info on what this dataset contains see [inventree/demo-dataset](https://github.com/inventree/demo-dataset).
If you need some demo test-data, run the `setup-test` task. This will import an `admin` user with the password `inventree`. For more info on what this dataset contains see [inventree/demo-dataset](../demo.md).
The new React-based UI will not be available by default. In order to set your development environment up to view the frontend, follow this guide.
The new UI requires a separate frontend server to run to serve data for the new Frontend.
The following documentation details how to setup and run a development installation of the InvenTree frontend user interface.
### Prerequisites
To run the frontend development server, you will need to have the following installed:
- Node.js
- Yarn
!!! note "Devcontainer"
The [devcontainer](./devcontainer.md) setup already includes all prerequisite packages, and is ready to run the frontend server.
### Install
The React frontend requires its own packages that aren't installed via the usual invoke tasks.
The React frontend requires its own packages that aren't installed via the usual [invoke](../start/invoke.md) tasks.
#### Docker
Run the following command:
`docker compose run inventree-dev-server invoke frontend-compile`
`docker compose run inventree-dev-server invoke int.frontend-compile`
This will install the required packages for running the React frontend on your InvenTree dev server.
#### Devcontainer
!!! warning "This guide assumes you already have a running devcontainer"
!!! info "All these steps are performed within Visual Studio Code"
Open a new terminal from the top menu by clicking `Terminal > New Terminal`
Make sure this terminal is running within the virtual env. The start of the last line should display `(venv)`
Run the command `invoke frontend-compile`. Wait for this to finish
Run the command `invoke int.frontend-compile`. Wait for this to finish
### Running
After finishing the install, you need to launch a frontend server to be able to view the new UI.
Using the previously described ways of running commands, execute the following:
`invoke frontend-dev` in your environment
`invoke dev.frontend-server` in your environment
This command does not run as a background daemon, and will occupy the window it's ran in.
### Accessing
@@ -40,7 +51,7 @@ When the frontend server is running, it will be available on port 5173.
i.e: https://localhost:5173/
!!! note "Backend Server"
The InvenTree backend server must also be running, for the frontend interface to have something to connect to! To launch a backend server, use the `invoke server` command.
The InvenTree backend server must also be running, for the frontend interface to have something to connect to! To launch a backend server, use the `invoke dev.server` command.
### Debugging
@@ -77,3 +88,49 @@ When running the frontend development server, some features may not work entirel
#### SSO Login
When logging into the frontend dev server via SSO, the redirect URL may not redirect correctly.
## Testing
The frontend codebase it tested using [Playwright](https://playwright.dev/). There are a large number of tests that cover the frontend codebase, which are run automatically as part of the CI pipeline.
### Install Playwright
To install the required packages to run the tests, you can use the following command:
```bash
cd src/frontend
npx playwright install
```
### Running Tests
To run the tests locally, in an interactive editor, you can use the following command:
```bash
cd src/frontend
npx playwright test --ui
```
This will first launch the backend server (at `http://localhost:8000`), and then run the tests against the frontend server (at `http://localhost:5173`). An interactive browser window will open, and you can run the tests individually or as a group.
### Viewing Reports
The playwright tests are run automatically as part of the project's CI pipeline, and the results are stored as a downloadable report. The report file can be "replayed" using playwright, to view the results of the test run, as well as closely inspect any failed tests.
To view the report, you can use the following command, after downloading the report and extracting from the zipped file:
```bash
npx playwright show-report path/to/report
```
### No Tests Found
If there is any problem in the testing launch sequence, the playwright UI will display the message "No Tests". In this case, an error has occurred, likely launching the InvenTree server process (which runs in the background).
To debug this situation, and determine what error needs to be resolved, run the following command:
```bash
npx playwright test --debug
```
This will print out any errors to the console, allowing you to resolve issues before continuing. In all likelihood, your InvenTree installation needs to be updated, and simply running `invoke update` will allow you to continue.
InvenTree has a builtin machine registry. There are different machine types available where each type can have different drivers. Drivers and even custom machine types can be provided by plugins.
!!! info "Requires Redis"
If the machines features is used in production setup using workers, a shared [redis cache](../../start/docker.md#redis-cache) is required to function properly.
If the machines features is used in production setup using workers, a shared [redis cache](../../start/processes.md#cache-server) is required to function properly.
### Registry
@@ -47,6 +47,8 @@ If you want to create your own machine type, please also take a look at the alre
@@ -83,7 +83,7 @@ The configuration entries must be enabled via the [InvenTree admin interface](..
!!! warning "Disabled by Default"
Newly discovered plugins are disabled by default, and must be manually enabled (in the admin interface) by a user with staff privileges.
### Plugin Mixins
## Plugin Mixins
Common use cases are covered by pre-supplied modules in the form of *mixins* (similar to how [Django]({% include "django.html" %}/topics/class-based-views/mixins/) does it). Each mixin enables the integration into a specific area of InvenTree. Sometimes it also enhances the plugin with helper functions to supply often used functions out-of-the-box.
@@ -106,3 +106,11 @@ Supported mixin classes are:
| [SettingsMixin](./plugins/settings.md) | Integrate user configurable settings |
| [UrlsMixin](./plugins/urls.md) | Respond to custom URL endpoints |
| [ValidationMixin](./plugins/validation.md) | Provide custom validation of database models |
## Static Files
If your plugin requires static files (e.g. CSS, JavaScript, images), these should be placed in the top level `static` directory within the distributed plugin package. These files will be automatically collected by InvenTree when the plugin is installed, and copied to an appropriate location.
These files will be available to the InvenTree web interface, and can be accessed via the URL `/static/plugins/<plugin_name>/<filename>`. Static files are served by the [proxy server](../start/processes.md#proxy-server).
For example, if the plugin is named `my_plugin`, and contains a file `CustomPanel.js`, it can be accessed via the URL `/static/plugins/my_plugin/CustomPanel.js`.
@@ -15,6 +15,151 @@ When a certain (server-side) event occurs, the background worker passes the even
{% include 'img.html' %}
{% endwith %}
## Events
Events are passed through using a string identifier, e.g. `build.completed`
The arguments (and keyword arguments) passed to the receiving function depend entirely on the type of event.
!!! info "Read the Code"
Implementing a response to a particular event requires a working knowledge of the InvenTree code base, especially related to that event being received. While the *available* events are documented here, to implement a response to a particular event you will need to read the code to understand what data is passed to the event handler.
## Generic Events
There are a number of *generic* events which are generated on certain database actions. Whenever a database object is created, updated, or deleted, a corresponding event is generated.
#### Object Created
When a new object is created in the database, an event is generated with the following event name: `<app>_<model>.created`, where `<model>` is the name of the model class (e.g. `part`, `stockitem`, etc).
The event is called with the following keywords arguments:
-`model`: The model class of the object that was created
-`id`: The primary key of the object that was created
**Example:**
A new `Part` object is created with primary key `123`, resulting in the following event being generated:
When an object is updated in the database, an event is generated with the following event name: `<app>_<model>.saved`, where `<model>` is the name of the model class (e.g. `part`, `stockitem`, etc).
The event is called with the following keywords arguments:
-`model`: The model class of the object that was updated
-`id`: The primary key of the object that was updated
**Example:**
A `Part` object with primary key `123` is updated, resulting in the following event being generated:
When an object is deleted from the database, an event is generated with the following event name: `<app>_<model>.deleted`, where `<model>` is the name of the model class (e.g. `part`, `stockitem`, etc).
The event is called with the following keywords arguments:
-`model`: The model class of the object that was deleted
-`id`: The primary key of the object that was deleted (if available)
**Example:**
A `Part` object with primary key `123` is deleted, resulting in the following event being generated:
Note that the event is triggered *after* the object has been deleted from the database, so the object itself is no longer available.
## Specific Events
In addition to the *generic* events listed above, there are a number of other events which are triggered by *specific* actions within the InvenTree codebase.
The available events are provided in the enumerations listed below. Note that while the names of the events are documented here, the exact arguments passed to the event handler will depend on the specific event being triggered.
### Build Events
::: build.events.BuildEvents
options:
show_bases: False
show_root_heading: False
show_root_toc_entry: False
show_source: True
members: []
### Part Events
::: part.events.PartEvents
options:
show_bases: False
show_root_heading: False
show_root_toc_entry: False
show_source: True
members: []
### Stock Events
::: stock.events.StockEvents
options:
show_bases: False
show_root_heading: False
show_root_toc_entry: False
show_source: True
members: []
### Purchase Order Events
::: order.events.PurchaseOrderEvents
options:
show_bases: False
show_root_heading: False
show_root_toc_entry: False
show_source: True
members: []
### Sales Order Events
::: order.events.SalesOrderEvents
options:
show_bases: False
show_root_heading: False
show_root_toc_entry: False
show_source: True
members: []
### Return Order Events
::: order.events.ReturnOrderEvents
options:
show_bases: False
show_root_heading: False
show_root_toc_entry: False
show_source: True
members: []
### Plugin Events
::: plugin.events.PluginEvents
options:
show_bases: False
show_root_heading: False
show_root_toc_entry: False
show_source: True
members: []
## Samples
### Sample Plugin - All events
Implementing classes must at least provide a `process_event` function:
@@ -40,12 +185,3 @@ Overall this function can reduce the workload on the background workers signific
show_root_toc_entry: False
show_source: True
members: []
## Events
Events are passed through using a string identifier, e.g. `build.completed`
The arguments (and keyword arguments) passed to the receiving function depend entirely on the type of event.
Implementing a response to a particular event requires a working knowledge of the InvenTree code base, especially related to that event being received.
This plugin mixin class is designed specifically for the the *legacy* user interface (which is rendered on the server using django templates). The new user interface (which is rendered on the client using React) does not support this mixin class. Instead, refer to the new [User Interface Mixin](./ui.md) class.
!!! warning "Deprecated Class"
This mixin class is considered deprecated, and will be removed in the 1.0.0 release.
The `PanelMixin` enables plugins to render custom content to "panels" on individual pages in the web interface.
Most pages in the web interface support multiple panels, which are selected via the sidebar menu on the left side of the screen:
The `UserInterfaceMixin` class provides a set of methods to implement custom functionality for the InvenTree web interface.
### Enable User Interface Mixin
To enable user interface plugins, the global setting `ENABLE_PLUGINS_INTERFACE` must be enabled, in the [plugin settings](../../settings/global.md#plugin-settings).
## Custom UI Features
The InvenTree user interface functionality can be extended in various ways using plugins. Multiple types of user interface *features* can be added to the InvenTree user interface.
The entrypoint for user interface plugins is the `UserInterfaceMixin` class, which provides a number of methods which can be overridden to provide custom functionality. The `get_ui_features` method is used to extract available user interface features from the plugin:
Note here that the `get_ui_features` calls other methods to extract the available features from the plugin, based on the requested feature type. These methods can be overridden to provide custom functionality.
!!! info "Implementation"
Your custom plugin does not need to override the `get_ui_features` method. Instead, override one of the other methods to provide custom functionality.
### UIFeature Return Type
The `get_ui_features` method should return a list of `UIFeature` objects, which define the available user interface features for the plugin. The `UIFeature` class is defined as follows:
::: plugin.base.ui.mixins.UIFeature
options:
show_bases: False
show_root_heading: False
show_root_toc_entry: False
show_sources: True
summary: False
members: []
Note that the *options* field contains fields which may be specific to a particular feature type - read the documentation below on each feature type for more information.
### Dynamic Feature Loading
Each of the provided feature types can be loaded dynamically by the plugin, based on the information provided in the API request. For example, the plugin can choose to show or hide a particular feature based on the user permissions, or the current state of the system.
For examples of this dynamic feature loading, refer to the [sample plugin](#sample-plugin) implementation which demonstrates how to dynamically load custom panels based on the provided context.
### Javascript Source Files
The rendering function for the custom user interface features expect that the plugin provides a Javascript source file which contains the necessary code to render the custom content. The path to this file should be provided in the `source` field of the `UIFeature` object.
Note that the `source` field can include the name of the function to be called (if this differs from the expected default function name).
The following user interface feature types are available:
### Dashboard Items
The InvenTree dashboard is a collection of "items" which are displayed on the main dashboard page. Custom dashboard items can be added to the dashboard by implementing the `get_ui_dashboard_items` method:
The frontend code expects a path to a javascript file containing a function named `renderDashboardItem` which will be called to render the custom dashboard item. Note that this function name can be overridden by appending the function name in the `source` field of the `UIFeature` object.
#### Example
Refer to the [sample plugin](#sample-plugin) for an example of how to implement server side rendering for custom panels.
### Panels
Many of the pages in the InvenTree web interface are built using a series of "panels" which are displayed on the page. Custom panels can be added to these pages, by implementing the `get_ui_panels` method:
The *options* field in the returned `UIFeature` object can contain the following properties:
::: plugin.base.ui.mixins.CustomPanelOptions
options:
show_bases: False
show_root_heading: False
show_root_toc_entry: False
show_sources: True
summary: False
members: []
#### Source Function
The frontend code expects a path to a javascript file containing a function named `renderPanel` which will be called to render the custom panel. Note that this function name can be overridden by appending the function name in the `source` field of the `UIFeature` object.
#### Example
Refer to the [sample plugin](#sample-plugin) for an example of how to implement server side rendering for custom panels.
### Template Editors
The `get_ui_template_editors` feature type can be used to provide custom template editors.
When rendering certain content in the user interface, the rendering functions are passed a `context` object which contains information about the current page being rendered. The type of the `context` object is defined in the `PluginContext` file:
This context data can be used to provide additional information to the rendering functions, and can be used to dynamically render content based on the current state of the system.
### Additional Context
Note that additional context can be passed to the rendering functions by adding additional key-value pairs to the `context` field in the `UIFeature` return type (provided by the backend via the API). This field is optional, and can be used at the discretion of the plugin developer.
## File Distribution
When distributing a custom UI plugin, the plugin should include the necessary frontend code to render the custom content. This frontend code should be included in the plugin package, and should be made available to the InvenTree frontend when the plugin is installed.
The simplest (and recommended) way to achieve this is to distribute the compiled javascript files with the plugin package, in a top-level `static` directory. This directory will be automatically collected by InvenTree when the plugin is installed, and the files will be copied to the appropriate location.
Read more about [static plugin files](../plugins.md#static-files) for more information.
## Sample Plugin
A (very simple) sample plugin which implements custom user interface functionality is provided in the InvenTree source code, which provides a full working example of how to implement custom user interface functionality.
When developing a custom UI plugin for InvenTree, the plugin should aim to match the existing InvenTree theme as closely as possible. This will help to ensure that the custom content fits seamlessly into the existing user interface.
To achieve this, we strongly recommend that you use the same framework as the InvenTree frontend - which is built using [React](https://react.dev) on top of the [Mantine](https://mantine.dev) UI component library.
### Mantine
The Mantine UI component library is used throughout the InvenTree frontend, and provides a consistent look and feel to the user interface. By using Mantine components in your custom UI plugin, you can ensure that your custom content fits seamlessly into the existing InvenTree theme.
### InvenTree Component Library
We are working to develop and distribute a library of custom InvenTree components which can be used to build custom UI plugins. This library will be made available to plugin developers in the near future.
### Examples
Refer to some of the existing InvenTree plugins linked above for examples of building custom UI plugins using the Mantine component library for seamless integration.
@@ -108,22 +108,71 @@ By default, part names are not subject to any particular naming conventions or r
If the custom method determines that the part name is *objectionable*, it should throw a `ValidationError` which will be handled upstream by parent calling methods.
Validation of the Part IPN (Internal Part Number) field is exposed to custom plugins via the `validate_part_IPN` method. Any plugins which extend the `ValidationMixin` class can implement this method, and raise a `ValidationError` if the IPN value does not match a required convention.
Validation of the Part IPN (Internal Part Number) field is exposed to custom plugins via the `validate_part_ipn` method. Any plugins which extend the `ValidationMixin` class can implement this method, and raise a `ValidationError` if the IPN value does not match a required convention.
[Part parameters](../../part/parameter.md) can also have custom validation rules applied, by implementing the `validate_part_parameter` method. A plugin which implements this method should raise a `ValidationError` with an appropriate message if the part parameter value does not match a required convention.
Requirements for serial numbers can vary greatly depending on the application. Rather than attempting to provide a "one size fits all" serial number implementation, InvenTree allows custom serial number schemes to be implemented via plugins.
@@ -134,17 +183,30 @@ The default InvenTree [serial numbering system](../../stock/tracking.md#serial-n
Custom serial number validation can be implemented using the `validate_serial_number` method. A *proposed* serial number is passed to this method, which then has the opportunity to raise a `ValidationError` to indicate that the serial number is not valid.
If the `stock_item` argument is provided, then this stock item has already been assigned with the provided serial number. This stock item should be excluded from any subsequent checks for *uniqueness*. The `stock_item` parameter is optional, and may be `None` if the serial number is being validated in a context where no stock item is available.
##### Example
A plugin which requires all serial numbers to be valid hexadecimal values may implement this method as follows:
part: The Part instance for which this serial number is being validated
stock_item: The StockItem instance for which this serial number is being validated
"""
try:
@@ -160,6 +222,15 @@ While InvenTree supports arbitrary text values in the serial number fields, behi
A custom plugin can implement the `convert_serial_to_int` method to determine how a particular serial number is converted to an integer representation.
If this method is not implemented, or the serial number cannot be converted to an integer, then the sorting algorithm falls back to the text (string) value
@@ -169,6 +240,15 @@ A core component of the InvenTree serial number system is the ability to *increm
For custom serial number schemes, it is important to provide a method to generate the *next* serial number given a current value. The `increment_serial_number` method can be implemented by a plugin to achieve this.
Refer to the [invoke guide](./start/invoke.md#cant-find-any-collection-named-tasks) for more information.
### Invoke Version
If the installed version of invoke is too old, users may see error messages during the installation procedure, such as:
If the installed version of invoke is too old, users may see error messages during the installation procedure. Refer to the [invoke guide](./start/invoke.md#minimum-version) for more information.
- *'update' did not receive all required positional arguments!*
- *Function has keyword-only arguments or annotations*
### INVE-E1 - No frontend included
As per the [invoke guide](./start/intro.md#invoke), the minimum required version of Invoke is `{{ config.extra.min_invoke_version }}`.
Make sure you are running a stable or production release of InvenTree. The frontend panel is not included in development releases.
More Information: [Error Codes - INVE-E1](./settings/error_codes.md#inve-e1)
To determine the version of invoke you have installed, run either:
```
invoke --version
```
```
python -m invoke --version
```
If you are running an older version of invoke, ensure it is updated to the latest version:
```
pip install -U invoke
```
### No module named 'django'
### No module named <xxx>
During the install or update process, you may be presented with an error like:
@@ -64,6 +49,27 @@ This error occurs because your installed python version is not up to date. We [r
You (or your system administrator) needs to update python to meet the minimum requirements for InvenTree.
### InvenTree Site URL
During the installation or update process, you may see an error similar to:
```
'No CSRF_TRUSTED_ORIGINS specified. Please provide a list of trusted origins, or specify INVENTREE_SITE_URL'
```
If you see this error, it means that the `INVENTREE_SITE_URL` environment variable has not correctly specified. Refer to the [configuration documentation](./start/config.md#site-url) for more information.
### Login Issues
If you have successfully started the InvenTree server, but are experiencing issues logging in, it may be due to the security interactions between your web browser and the server. While the default configuration should work for most users, if you do experience login issues, ensure that your [server access settings](./start/config.md#server-access) are correctly configured.
### Session Cookies
The [0.17.0 release](https://github.com/inventree/InvenTree/releases/tag/0.17.0) included [a change to the way that session cookies were handled](https://github.com/inventree/InvenTree/pull/8269). This change may cause login issues for existing InvenTree installs which are upgraded from an older version. System administrators should refer to the [server access settings](./start/config.md#server-access) and ensure that the following settings are correctly configured:
- **INVENTREE_SESSION_COOKIE_SECURE**: `False`
- **INVENTREE_COOKIE_SAMESITE**: `False`
## Update Issues
Sometimes, users may encounter unexpected error messages when updating their InvenTree installation to a newer version.
@@ -83,6 +89,26 @@ For more information, refer to the installation guides:
!!! warning "Invoke Update"
You must ensure that the `invoke update` command is performed *every time* you update InvenTree
### Breaking Changes
Before performing an update, check the release notes! Any *breaking changes* (changes which require user intervention) will be clearly noted.
### Cannot import name get_storage_class
When running an install or update, you may see an error similar to:
In such a situation, it is likely that the automatic backup procedure is unable to run, as the required python packages are not yet installed or are unavailable.
To proceed in this case, you can skip the backup procedure by running the `invoke update` command with the `--skip-backup` flag:
```bash
invoke update --skip-backup
```
### Feature *x* does not work after update
If a particular menu / item is not visible after updating InvenTree, or a certain function no longer seems to work, it may be due to your internet browser caching old versions of CSS and JavaScript files.
@@ -20,6 +20,7 @@ Each Purchase Order has a specific status code which indicates the current state
| --- | --- |
| Pending | The purchase order has been created, but has not been submitted to the supplier |
| In Progress | The purchase order has been issued to the supplier, and is in progress |
| On Hold | The purchase order has been placed on hold, but is still active |
| Complete | The purchase order has been completed, and is now closed |
| Cancelled | The purchase order was cancelled, and is now closed |
| Lost | The purchase order was lost, and is now closed |
@@ -37,6 +38,8 @@ Refer to the source code for the Purchase Order status codes:
show_source: True
members: []
Purchase Order Status supports [custom states](../concepts/custom_states.md).
### Purchase Order Currency
The currency code can be specified for an individual purchase order. If not specified, the default currency specified against the [supplier](./company.md#suppliers) will be used.
@@ -90,6 +93,14 @@ There are two options to mark items as "received":
!!! note "Permissions"
Marking line items as received requires the "Purchase order" ADD permission.
### Item Location
When receiving items from a purchase order, the location of the items must be specified. There are multiple ways to specify the location:
* **Order Destination**: The *destination* field of the purchase order can be set to a specific location. When receiving items, the location will default to the destination location.
* **Line Item Location**: Each line item can have a specific location set. When receiving items, the location will default to the line item location. *Note: A destination specified at the line item level will override the destination specified at the order level.*
### Received Items
Each item marked as "received" is automatically converted into a stock item.
@@ -138,3 +149,14 @@ This view can be accessed externally as an ICS calendar using a URL like the fol
@@ -45,6 +45,7 @@ Each Return Order has a specific status code, as follows:
| --- | --- |
| Pending | The return order has been created, but not sent to the customer |
| In Progress | The return order has been issued to the customer |
| On Hold | The return order has been placed on hold, but is still active |
| Complete | The return order was marked as complete, and is now closed |
| Cancelled | The return order was cancelled, and is now closed |
@@ -60,6 +61,8 @@ Refer to the source code for the Return Order status codes:
show_source: True
members: []
Return Order Status supports [custom states](../concepts/custom_states.md).
## Create a Return Order
From the Return Order index, click on <span class='badge inventree add'><span class='fas fa-plus-circle'></span> New Return Order</span> which opens the "Create Return Order" form.
@@ -120,3 +123,14 @@ This view can be accessed externally as an ICS calendar using a URL like the fol
@@ -20,6 +20,7 @@ Each Sales Order has a specific status code, which represents the state of the o
| --- | --- |
| Pending | The sales order has been created, but has not been finalized or submitted |
| In Progress | The sales order has been issued, and is in progress |
| On Hold | The sales order has been placed on hold, but is still active |
| Shipped | The sales order has been shipped, but is not yet complete |
| Complete | The sales order is fully completed, and is now closed |
| Cancelled | The sales order was cancelled, and is now closed |
@@ -38,6 +39,8 @@ Refer to the source code for the Sales Order status codes:
show_source: True
members: []
Sales Order Status supports [custom states](../concepts/custom_states.md).
### Sales Order Currency
The currency code can be specified for an individual sales order. If not specified, the default currency specified against the [customer](./company.md#customers) will be used.
@@ -182,3 +185,15 @@ All these fields can be edited by the user:
{% with id="edit-shipment", url="order/edit_shipment.png", description="Edit shipment" %}
{% include "img.html" %}
{% endwith %}
## Sales Order Settings
The following [global settings](../settings/global.md) are available for sales orders:
@@ -26,6 +26,7 @@ Parameter templates are used to define the different types of parameters which a
| Units | Optional units field (*must be a valid [physical unit](#parameter-units)*) |
| Choices | A comma-separated list of valid choices for parameter values linked to this template. |
| Checkbox | If set, parameters linked to this template can only be assigned values *true* or *false* |
| Selection List | If set, parameters linked to this template can only be assigned values from the linked [selection list](#selection-lists) |
### Create Template
@@ -105,3 +106,12 @@ Parameter sorting takes unit conversion into account, meaning that values provid
{% with id="sort_by_param_units", url="part/part_sorting_units.png", description="Sort by Parameter Units" %}
{% include 'img.html' %}
{% endwith %}
### Selection Lists
Selection Lists can be used to add a large number of predefined values to a parameter template. This can be useful for parameters which must be selected from a large predefined list of values (e.g. a list of standardised colo codes). Choices on templates are limited to 5000 characters, selection lists can be used to overcome this limitation.
It is possible that plugins lock selection lists to ensure a known state.
Administration of lists can be done through the Part Parameter section in the Admin Center or via the API.
@@ -47,6 +47,10 @@ If a part is designated as an *Assembly* it can be created (or built) from other
If a part is designated as a *Component* it can be used as a sub-component of an *Assembly*. [Read further information about BOM management here](../build/bom.md)
### Testable
Testable parts can have test templates defined against the part, allowing test results to be recorded against any stock items for that part. For more information on testing, refer to the [testing documentation](./test.md).
### Trackable
Trackable parts can be assigned batch numbers or serial numbers which uniquely identify a particular stock item. Trackable parts also provide other features (and restrictions) in the InvenTree ecosystem.
Parts which are designated as *trackable* (meaning they can be uniquely serialized) can define templates for tests which are to be performed against individual stock items corresponding to the part.
Parts which are designated as [testable](./part.md#testable) can define templates for tests which are to be performed against individual stock items corresponding to the part.
A test template defines the parameters of the test; the individual stock items can then have associated test results which correspond to a test template.
@@ -131,9 +131,9 @@ The *Scheduling* tab provides an overview of the *predicted* future availability
The *Stocktake* tab provide historical stock level information, based on user-provided stocktake data. Refer to the [stocktake documentation](./stocktake.md) for further information.
### Tests
### Test Templates
If a part is marked as *trackable*, the user can define tests which must be performed on any stock items which are instances of this part. [Read more about testing](./test.md).
If a part is marked as *testable*, the user can define tests which must be performed on any stock items which are instances of this part. [Read more about testing](./test.md).
@@ -81,7 +81,7 @@ Multiple improvements have been made to the docker installation process, most no
### QR code scanner
[#2779](https://github.com/inventree/InvenTree/pull/2779) provides a QR code scanner which can be used to quickly scan Inventree generated QR codes using webcams or mobile devices. This feature requires secure (HTTPS) connection to the server.
[#2779](https://github.com/inventree/InvenTree/pull/2779) provides a QR code scanner which can be used to quickly scan InvenTree generated QR codes using webcams or mobile devices. This feature requires secure (HTTPS) connection to the server.
Note the use of the `as` keyword to assign the output of the function to a variable. This can be used to assign the result of a function to a named variable, which can then be used later in the template.
## Data Structure Access
A number of helper functions are available for accessing data contained in a particular structure format:
@@ -41,6 +43,13 @@ A number of helper functions are available for accessing data contained in a par
To return the element at a given index in a container which supports indexed access (such as a [list](https://www.w3schools.com/python/python_lists.asp)), use the `getindex` function:
::: report.templatetags.report.getindex
options:
show_docstring_description: false
show_source: False
#### Example
```html
{% raw %}
{% getindex my_list 1 as value %}
@@ -53,6 +62,13 @@ Item: {{ value }}
To return an element corresponding to a certain key in a container which supports key access (such as a [dictionary](https://www.w3schools.com/python/python_dictionaries.asp)), use the `getkey` function:
::: report.templatetags.report.getkey
options:
show_docstring_description: false
show_source: False
#### Example
```html
{% raw %}
<ul>
@@ -64,10 +80,91 @@ To return an element corresponding to a certain key in a container which support
{% endraw %}
```
## Database Helpers
A number of helper functions are available for accessing database objects:
### filter_queryset
The `filter_queryset` function allows for arbitrary filtering of the provided querysert. It takes a queryset and a list of filter arguments, and returns a filtered queryset.
::: report.templatetags.report.filter_queryset
options:
show_docstring_description: false
show_source: False
!!! info "Provided QuerySet"
The provided queryset must be a valid Django queryset object, which is already available in the template context.
!!! warning "Advanced Users"
The `filter_queryset` function is a powerful tool, but it is also easy to misuse. It assumes that the user has a good understanding of Django querysets and the underlying database structure.
#### Example
In a report template which has a `PurchaseOrder` object available in its context, fetch any line items which have a received quantity greater than zero:
```html
{% raw %}
{% load report %}
{% filter_queryset order.lines.all received__gt=0 as received_lines %}
The `filter_db_model` function allows for filtering of a database model based on a set of filter arguments. It takes a model class and a list of filter arguments, and returns a filtered queryset.
::: report.templatetags.report.filter_db_model
options:
show_docstring_description: false
show_source: False
#### Example
Generate a list of all active customers:
```html
{% raw %}
{% load report %}
{% filter_db_model company.company is_customer=True active=True as active_customers %}
<ul>
{% for customer in active_customers %}
<li>{{ customer.name }}</li>
{% endfor %}
</ul>
{% endraw %}
```
### Advanced Database Queries
More advanced database filtering should be achieved using a [report plugin](../extend/plugins/report.md), and adding custom context data to the report template.
## Number Formatting
### format_number
The helper function `format_number` allows for some common number formatting options. It takes a number (or a number-like string) as an input, as well as some formatting arguments. It returns a *string* containing the formatted number:
::: report.templatetags.report.format_number
options:
show_docstring_description: false
show_source: False
#### Example
```html
{% raw %}
{% load report %}
@@ -82,15 +179,24 @@ The helper function `format_number` allows for some common number formatting opt
For rendering date and datetime information, the following helper functions are available:
-`format_date`: Format a date object
-`format_datetime`: Format a datetime object
### format_date
Each of these helper functions takes a date or datetime object as an input, and returns a *string* containing the formatted date or datetime. The following additional arguments are available:
::: report.templatetags.report.format_date
options:
show_docstring_description: false
show_source: False
### format_datetime
::: report.templatetags.report.format_datetime
options:
show_docstring_description: false
show_source: False
### Date Formatting
If not specified, these methods return a result which uses ISO formatting. Refer to the [datetime format codes](https://docs.python.org/3/library/datetime.html#format-codes) for more information! |
| Argument | Description |
| --- | --- |
| timezone | Specify the timezone to render the date in. If not specified, uses the InvenTree server timezone |
| format | Specify the format string to use for rendering the date. If not specified, uses ISO formatting. Refer to the [datetime format codes](https://docs.python.org/3/library/datetime.html#format-codes) for more information! |
The helper function `render_currency` allows for simple rendering of currency data. This function can also convert the specified amount of currency into a different target currency:
*Media files* are any files uploaded to the InvenTree server by the user. These are stored under the `/media/` directory and can be accessed for use in custom reports or labels.
### Uploaded Images
### uploaded_image
You can access an uploaded image file if you know the *path* of the image, relative to the top-level `/media/` directory. To load the image into a report, use the `{% raw %}{% uploaded_image ... %}{% endraw %}` tag:
::: report.templatetags.report.uploaded_image
options:
show_docstring_description: false
show_source: False
```html
{% raw %}
<!-- Load the report helper functions -->
@@ -199,7 +340,12 @@ The `{% raw %}{% uploaded_image %}{% endraw %}` tag supports some optional param
{% endraw %}```
### SVG Images
### encode_svg_image
::: report.templatetags.report.encode_svg_image
options:
show_docstring_description: false
show_source: False
SVG images need to be handled in a slightly different manner. When embedding an uploaded SVG image, use the `{% raw %}{% encode_svg_image ... %}{% endraw %}` tag:
@@ -211,10 +357,15 @@ SVG images need to be handled in a slightly different manner. When embedding an
{% endraw %}
```
### Partimages
### part_image
A shortcut function is provided for rendering an image associated with a Part instance. You can render the image of the part using the `{% raw %}{% part_image ... %}{% endraw %}` template tag:
::: report.templatetags.report.part_image
options:
show_docstring_description: false
show_source: False
```html
{% raw %}
<!-- Load the report helper functions -->
@@ -225,7 +376,7 @@ A shortcut function is provided for rendering an image associated with a Part in
#### Image Arguments
Any optional arguments which can be used in the [uploaded_image tag](#uploaded-images) can be used here too.
Any optional arguments which can be used in the [uploaded_image tag](#uploaded_image) can be used here too.
#### Image Variations
@@ -243,10 +394,15 @@ The *Part* model supports *preview* (256 x 256) and *thumbnail* (128 x 128) vers
```
### Company Images
### company_image
A shortcut function is provided for rendering an image associated with a Company instance. You can render the image of the company using the `{% raw %}{% company_image ... %}{% endraw %}` template tag:
::: report.templatetags.report.company_image
options:
show_docstring_description: false
show_source: False
```html
{% raw %}
<!-- Load the report helper functions -->
@@ -326,7 +482,14 @@ You can add asset images to the reports and labels by using the `{% raw %}{% ass
## Part Parameters
If you need to load a part parameter for a particular Part, within the context of your template, you can use the `part_parameter` template tag.
If you need to load a part parameter for a particular Part, within the context of your template, you can use the `part_parameter` template tag:
::: report.templatetags.report.part_parameter
options:
show_docstring_description: false
show_source: False
### Example
The following example assumes that you have a report or label which contains a valid [Part](../part/part.md) instance:
@@ -177,7 +177,7 @@ Asset files can be rendered directly into the template as follows
If the requested asset name does not match the name of an uploaded asset, the template will continue without loading the image.
!!! info "Assets location"
You need to ensure your asset images to the report/assets directory in the [data directory](../start/intro.md#file-storage). Upload new assets via the [admin interface](../settings/admin.md) to ensure they are uploaded to the correct location on the server.
Upload new assets via the [admin interface](../settings/admin.md) to ensure they are uploaded to the correct location on the server.
InvenTree is starting to use error codes to help identify and diagnose issues. These are increasingly being added to the codebase. Error messages missing an error code should be reported on GitHub.
Error codes are prefixed with `INVE-` and are followed by a letter to indicate the type of error and a number to indicate the specific error. Once a code is used it might not be reassigned to a different error, it can be marked as stricken from the list.
### INVE-E (InvenTree Error)
Errors - These are critical errors which should be addressed as soon as possible.
#### INVE-E1
**No frontend included - Backend/web**
Only stable / production releases of InvenTree include the frontend panel. This is both a measure of resource-saving and attack surface reduction. If you want to use the frontend panel, you can either:″
- use a docker image that is version-tagged or the stable version
- use a package version that is from the stable or version stream
- install node and yarn on the server to build the frontend with the [invoke](../start/invoke.md) task `int.frontend-build`
Raise an issue if none of these options work.
### INVE-W (InvenTree Warning)
Warnings - These are non-critical errors which should be addressed when possible.
### INVE-I (InvenTree Information)
Information — These are not errors but information messages. They might point out potential issues or just provide information.
### INVE-M (InvenTree Miscellaneous)
Miscellaneous — These are information messages that might be used to mark debug information or other messages helpful for the InvenTree team to understand behaviour.
| InvenTree Instance Name | String | String descriptor for the InvenTree server instance | InvenTree Server |
| Use Instance Name | Boolean | Use instance name in title bars | False |
| Restrict showing `about` | Boolean | Show the `about` modal only to superusers | False |
| Base URL | String | Base URL for server instance | *blank* |
| Company Name | String | Company name | My company name |
| Download from URL | Boolean | Allow downloading of images from remote URLs | False |
### Login Settings
Change how logins, password-forgot, signups are handled.
Change how logins, password-forgot, signups are handled:
| Setting | Type | Description | Default |
| --- | --- | --- | --- |
| Enable registration | Boolean | Enable self-registration for users on the login-pages | False |
| Enable SSO | Boolean | Enable SSO on the login-pages | False |
| Enable SSO registration | Boolean | Enable self-registration for users via SSO on the login-pages | False |
| Enable SSO group sync | Boolean | Enable synchronizing InvenTree groups directly from the IdP | False |
| SSO group key | String | The name of the groups claim attribute provided by the IdP | |
| SSO group map | String (JSON) | A mapping from SSO groups to local InvenTree groups | {} |
| Remove groups outside of SSO | Boolean | Whether groups assigned to the user should be removed if they are not backend by the IdP. Disabling this setting might cause security issues | True |
| Enable password forgot | Boolean | Enable password forgot function on the login-pages.<br><br>This will let users reset their passwords on their own. For this feature to work you need to configure E-mail | True |
| E-Mail required | Boolean | Require user to supply e-mail on signup.<br><br>Without a way (e-mail) to contact the user notifications and security features might not work! | False |
| Enforce MFA | Boolean | Users must use multifactor security.<br><br>This forces each user to setup MFA and use it on each authentication | False |
| Mail twice | Boolean | On signup ask users twice for their mail | False |
| Password twice | Boolean | On signup ask users twice for their password | True |
| Auto-fill SSO users | Boolean | Automatically fill out user-details from SSO account-data.<br><br>If this feature is enabled the user is only asked for their username, first- and surname if those values can not be gathered from their SSO profile. This might lead to unwanted usernames bleeding over. | True |
| Allowed domains | String | Restrict signup to certain domains (comma-separated, starting with @) | |
If this setting is enabled, users must provide an email address when signing up. Note that some notification and security features require a valid email address.
#### Forgot Password
If this setting is enabled, users can reset their password via email. This requires a valid email address to be associated with the user account.
#### Enforce Multi-Factor Authentication
If this setting is enabled, users must have multi-factor authentication enabled to log in.
#### Auto Fil SSO Users
Automatically fill out user-details from SSO account-data. If this feature is enabled the user is only asked for their username, first- and surname if those values can not be gathered from their SSO profile. This might lead to unwanted usernames bleeding over.
### Barcodes
Configuration of barcode functionality
Configuration of barcode functionality:
| Setting | Type | Description | Default |
| --- | --- | --- | --- |
| Barcode Support | Boolean | Enable barcode functionality in web interface | True |
| Name | Description | Default | Units |
| ---- | ----------- | ------- | ----- |
{{ globalsetting("BARCODE_ENABLE") }}
{{ globalsetting("BARCODE_INPUT_DELAY") }}
{{ globalsetting("BARCODE_WEBCAM_SUPPORT") }}
{{ globalsetting("BARCODE_SHOW_TEXT") }}
{{ globalsetting("BARCODE_GENERATION_PLUGIN") }}
{{ globalsetting("BARCODE_STORE_RESULTS") }}
{{ globalsetting("BARCODE_RESULTS_MAX_NUM") }}
### Currencies
### Pricing and Currency
Configuration of currency support
Configuration of pricing data and currency support:
| Test Reports | Boolean | Enable generation of test reports | False |
| Name | Description | Default | Units |
| ---- | ----------- | ------- | ----- |
{{ globalsetting("REPORT_ENABLE") }}
{{ globalsetting("REPORT_DEFAULT_PAGE_SIZE") }}
{{ globalsetting("REPORT_DEBUG_MODE") }}
{{ globalsetting("REPORT_LOG_ERRORS") }}
### Parts
#### Main Settings
| Setting | Type | Description | Default |
| --- | --- | --- | --- |
| IPN Regex | String | Regular expression pattern for matching Part IPN | *blank* |
| Allow Duplicate IPN | Boolean | Allow multiple parts to share the same IPN | True |
| Allow Editing IPN | Boolean | Allow changing the IPN value while editing a part | True |
| Part Name Display Format | String | Format to display the part name | {% raw %}`{{ part.id if part.id }}{{ ' | ' if part.id }}{{ part.name }}{{ ' | ' if part.revision }}{{ part.revision if part.revision }}`{% endraw %} |
| Show Price History | Boolean | Display historical pricing for Part | False |
| Show Price in Forms | Boolean | Display part price in some forms | True |
| Show Price in BOM | Boolean | Include pricing information in BOM tables | True |
| Show related parts | Boolean | Display related parts for a part | True |
| Create initial stock | Boolean | Create initial stock on part creation | True |
#### Creation Settings
| Setting | Type | Description | Default |
| --- | --- | --- | --- |
| Template | Boolean | Parts are templates by default | False |
| Assembly | Boolean | Parts can be assembled from other components by default | False |
| Component | Boolean | Parts can be used as sub-components by default | True |
| Trackable | Boolean | Parts are trackable by default | False |
| Purchaseable | Boolean | Parts are purchaseable by default | True |
| Salable | Boolean | Parts are salable by default | False |
| Virtual | Boolean | Parts are virtual by default | False |
#### Copy Settings
| Setting | Type | Description | Default |
| --- | --- | --- | --- |
| Copy Part BOM Data | Boolean | Copy BOM data by default when duplicating a part | True |
| Copy Part Parameter Data | Boolean | Copy parameter data by default when duplicating a part | True |
| Copy Part Test Data | Boolean | Copy test data by default when duplicating a part | True |
| Copy Category Parameter Templates | Boolean | Copy category parameter templates when creating a part | True |
#### Internal Price Settings
| Setting | Type | Description | Default |
| --- | --- | --- | --- |
| Internal Prices | Boolean | Enable internal prices for parts | False |
| Internal Price as BOM-Price | Boolean | Use the internal price (if set) in BOM-price calculations | False |
#### Part Import Setting
This section of the part settings allows staff users to:
- import parts to InvenTree clicking the <span class="badge inventree add"><span class='fas fa-plus-circle'></span> Import Part</span> button
- enable the ["Import Parts" tab in the part category view](../part/part.md#part-import).
| Setting | Type | Description | Default |
| --- | --- | --- | --- |
| Show Import in Views | Boolean | Display the import wizard in some part views | True |
@@ -32,8 +32,9 @@ When building a reference, the following variables are available for use:
| Variable | Description |
| --- | --- |
| `{% raw %}{ref}{% endraw %}` | Incrementing portion of the reference (**required*)). Determines which part of the reference field auto-increments |
| `{% raw %}{ref}{% endraw %}` | Incrementing portion of the reference (**required*). Determines which part of the reference field auto-increments |
| `{% raw %}{date}{% endraw %}` | The current date / time. This is a [Python datetime object](https://docs.python.org/3/library/datetime.html#datetime.datetime.now) |
| `{% raw %}{?:default}{% endraw %}` | A wildcard *with default*. Any character(s) will be accepted in this position, but the reference pattern suggests the character(s) specified. |
The reference field pattern uses <a href="https://www.w3schools.com/python/ref_string_format.asp">Python string formatting</a> for value substitution.
@@ -44,8 +45,9 @@ The reference field pattern uses <a href="https://www.w3schools.com/python/ref_s
Some examples below demonstrate how the variable substitution can be implemented:
| Pattern | Description | Example Output |
| Pattern | Description | Example Output(s) |
| --- | --- | --- |
| `{% raw %}PO-{ref}{% endraw %}` | Render the *reference* variable without any custom formatting | PO-123 |
| `{% raw %}PO-{ref:05d}{% endraw %}` | Render the *reference* variable as a 5-digit decimal number | PO-00123 |
| `{% raw %}PO-{ref:05d}-{?:A}{% endraw %}` | *Require* a wildcard suffix with default suggested suffix `"A"`. | PO-00123-A <br> PO-00123-B |
| `{% raw %}PO-{ref:05d}-{date:%Y-%m-%d}{% endraw %}` | Render the *date* variable in isoformat | PO-00123-2023-01-17 |
By default, InvenTree does not ship with any user accounts. Configuring user accounts is the first step to login to the InvenTree server.
### Administrator Account
You can configure InvenTree to create an administrator account on the first run. This account will have full *superuser* access to the InvenTree server.
This account is created when you first run the InvenTree server instance. The username / password for this account can be configured in the configuration file, or environment variables.
!!! info "More Information"
For more information on configuring the administrator account, refer to the [configuration documentation](./config.md#administrator-account).
### Create Superuser
Another way to create an administrator account is to use the `superuser` command (via [invoke](./invoke.md)). This will create a new superuser account with the specified username and password.
```bash
invoke superuser
```
Or, if you are running InvenTree in a Docker container:
Once you have created an administrator account, you can create and manage additional user accounts from the InvenTree web interface.
## Password Management
### Reset Password via Command Line
If a password has been lost, and other backup options (such as email recovery) are unavailable, the system administrator can reset the password for a user account from the command line.
Log into the machine running the InvenTree server, and run the following command (from the top-level source directory):
```bash
cd src/backend/InvenTree
python ./manage.py changepassword <username>
```
The system will prompt you to enter a new password for the specified user account.
The installer code is used to identify the way InvenTree was installed. If you vendor InvenTree, you can and should set the installer code to your own value to make sure debugging goes smoothly.
@@ -64,15 +63,19 @@ Next you can start configuring the connection. Either use the config file or set
| `ldap.user_dn_template` | `INVENTREE_LDAP_USER_DN_TEMPLATE` | use direct bind as auth user, `ldap.bind_dn` and `ldap.bin_password` is not necessary then, e.g. `uid=%(user)s,dc=example,dc=org` |
| `ldap.global_options` | `INVENTREE_LDAP_GLOBAL_OPTIONS` | set advanced options as dict, e.g. TLS settings. For a list of all available options, see [python-ldap docs](https://www.python-ldap.org/en/latest/reference/ldap.html#ldap-options). (keys and values starting with OPT_ get automatically converted to `python-ldap` keys) |
| `ldap.user_attr_map` | `INVENTREE_LDAP_USER_ATTR_MAP` | LDAP <-> Inventree user attribute map, can be json if used as env, in yml directly specify the object. default: `{"first_name": "givenName", "last_name": "sn", "email": "mail"}` |
| `ldap.user_attr_map` | `INVENTREE_LDAP_USER_ATTR_MAP` | LDAP <-> InvenTree user attribute map, can be json if used as env, in yml directly specify the object. default: `{"first_name": "givenName", "last_name": "sn", "email": "mail"}` |
| `ldap.always_update_user` | `INVENTREE_LDAP_ALWAYS_UPDATE_USER` | Always update the user on each login, default: `true` |
| `ldap.cache_timeout` | `INVENTREE_LDAP_CACHE_TIMEOUT` | cache timeout to reduce traffic with LDAP server, default: `3600` (1h) |
| `ldap.group_search` | `INVENTREE_LDAP_GROUP_SEARCH` | Base LDAP DN for group searching; required to enable group features |
| `ldap.group_object_class` | `INVENTREE_LDAP_GROUP_OBJECT_CLASS` | The string to pass to the LDAP group search `(objectClass=<...>)`, default: `groupOfUniqueNames` |
| `ldap.mirror_groups` | `INVENTREE_LDAP_MIRROR_GROUPS` | If `True`, mirror a user's LDAP group membership in the Django database, default: `False` |
| `ldap.group_type_class` | `INVENTREE_LDAP_GROUP_TYPE_CLASS` | The group class to be imported from `django_auth_ldap.config` as a string, default: `'GroupOfUniqueNamesType'`|
| `ldap.group_type_class_args` | `INVENTREE_LDAP_GROUP_TYPE_CLASS_ARGS` | A `list` of positional args to pass to the LDAP group type class, default `[]` |
| `ldap.group_type_class_kwargs` | `INVENTREE_LDAP_GROUP_TYPE_CLASS_KWARGS` | A `dict` of keyword args to pass to the LDAP group type class, default `{'name_attr': 'cn'}` |
| `ldap.require_group` | `INVENTREE_LDAP_REQUIRE_GROUP` | If set, users _must_ be in this group to log in to InvenTree |
| `ldap.deny_group` | `INVENTREE_LDAP_DENY_GROUP` | If set, users _must not_ be in this group to log in to InvenTree |
| `ldap.user_flags_by_group` | `INVENTREE_LDAP_USER_FLAGS_BY_GROUP` | LDAP group to InvenTree user flag map, can be json if used as env, in yml directly specify the object. See config template for example, default: `{}` |
## Tracing support
Starting with 0.14.0 InvenTree supports sending traces, logs and metrics to OpenTelemetry compatible endpoints (both HTTP and gRPC). A [list of vendors](https://opentelemetry.io/ecosystem/vendors) is available on the project site.
@@ -99,4 +102,4 @@ If your InvenTree instance is used in a multi-site environment, you can enable m
@@ -17,7 +17,7 @@ InvenTree includes a simple server application, suitable for use in a developmen
To run the development server on a local machine, run the command:
```
(env) invoke server
(env) invoke dev.server
```
This will launch the InvenTree web interface at `http://127.0.0.1:8000`.
@@ -25,7 +25,7 @@ This will launch the InvenTree web interface at `http://127.0.0.1:8000`.
A different port can be specified using the `-a` flag:
```
(env) invoke server -a 127.0.0.1:8123
(env) invoke dev.server -a 127.0.0.1:8123
```
Serving on the address `127.0.0.1` means that InvenTree will only be available *on that computer*. The server will be accessible from a web browser on the same computer, but not from any other computers on the local network.
@@ -35,12 +35,12 @@ Serving on the address `127.0.0.1` means that InvenTree will only be available *
To enable access to the InvenTree server from other computers on a local network, you need to know the IP of the computer running the server. For example, if the server IP address is `192.168.120.1`:
```
(env) invoke server -a 192.168.120.1:8000
(env) invoke dev.server -a 192.168.120.1:8000
```
## Background Worker
The background task manager must also be started. The InvenTree server is already running in the foreground, so open a *new shell window* to start the server.
The [background task manager](./processes.md#background-worker) must also be started. The InvenTree server is already running in the foreground, so open a *new shell window* to start the server.
### Activate Virtual Environment
@@ -55,4 +55,4 @@ source ./env/bin/activate
(env) invoke worker
```
This will start the background process manager in the current shell.
This will start an instance of the background worker in the current shell.
@@ -19,7 +19,7 @@ The InvenTree web server is hosted using [Gunicorn](https://gunicorn.org/). Guni
### Supervisor
[Supervisor](http://supervisord.org/) is a process control system which monitors and controls multiple background processes. It is used in the InvenTree production setup to ensure that the server and background worker processes are always running.
[Supervisor](http://supervisord.org/) is a process control system which monitors and controls multiple background processes. It is used in the InvenTree production setup to ensure that the [web server](./processes.md#web-server) and [background worker](./processes.md#background-worker) processes are always running.
## Gunicorn
@@ -98,11 +98,12 @@ The InvenTree server (and background task manager) should now be running!
In addition to the InvenTree server, you will need a method of delivering static and media files (this is *not* handled by the InvenTree server in a production environment).
!!! info "Read More"
Refer to the [Serving Files](./serving_files.md) section for more details
Refer to the [proxy server documentation](./processes.md#proxy-server) for more details
### Next Steps
You (or your system administrator) may wish to perform further steps such as placing the InvenTree server behind a reverse-proxy such as [caddy](https://caddyserver.com/), or [nginx](https://www.nginx.com/).
You (or your system administrator) may wish to perform further steps such as placing the InvenTree server behind a [reverse proxy](./processes.md#proxy-server) such as [caddy](https://caddyserver.com/), or [nginx](https://www.nginx.com/).
As production environment options are many and varied, such tasks are outside the scope of this documentation.
There are many great online tutorials about running django applications in production!
The default configuration file (as defined by the template linked above) will be copied to the specified configuration file location on first run, if a configuration file is not found in that location.
@@ -46,6 +46,14 @@ Environment variable settings generally use the `INVENTREE_` prefix, and are all
!!! warning "Available Variables"
Some configuration options cannot be set via environment variables. Refer to the documentation below.
#### List Values
To specify a list value in an environment variable, use a comma-separated list. For example, to specify a list of trusted origins:
@@ -68,9 +71,11 @@ The following basic options are available:
The *INVENTREE_SITE_URL* option defines the base URL for the InvenTree server. This is a critical setting, and it is required for correct operation of the server. If not specified, the server will attempt to determine the site URL automatically - but this may not always be correct!
The site URL is the URL that users will use to access the InvenTree server. For example, if the server is accessible at `https://inventree.example.com`, the site URL should be set to `https://inventree.example.com`. Note that this is not necessarily the same as the internal URL that the server is running on - the internal URL will depend entirely on your server configuration and may be obscured by a reverse proxy or other such setup.
### Timezone
By default, the InvenTree server is configured to use the UTC timezone. This can be adjusted to your desired local timezone. You can refer to [Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for a list of available timezones. Use the values specified in the *TZ Identifier* column in the linked page.
By default, the InvenTree server is configured to use the UTC timezone. This can be adjusted to your desired local timezone. You can refer to [Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for a list of available timezones. Use the values specified in the *TZ Identifier* column in the linked page. For example, to change to the United States Pacific timezone, set `INVENTREE_TIMEZONE='America/Los_Angeles'`.
Date and time values are stored in the database in UTC format, and are converted to the selected timezone for display in the user interface or API.
@@ -80,6 +85,36 @@ By default, the InvenTree server will not automatically apply database migration
With "auto update" enabled, the InvenTree server will automatically apply database migrations as required. To enable automatic database updates, set `INVENTREE_AUTO_UPDATE` to `True`.
## Debugging and Logging Options
The following debugging / logging options are available:
| INVENTREE_WRITE_LOG | write_log | Enable writing of log messages to file at config base | False |
### Debug Mode
Enabling the `INVENTREE_DEBUG` setting will turn on [Django debug mode]({% include "django.html" %}/ref/settings/#debug). This mode is intended for development purposes, and should not be enabled in a production environment. Read more about [InvenTree debug mode](./intro.md#debug-mode).
### Query Count Logging
Enabling the `INVENTREE_DEBUG_QUERYCOUNT` setting will log the number of database queries executed for each page load. This can be useful for identifying performance bottlenecks in the InvenTree server. Note that this setting is only available if `INVENTREE_DEBUG` is also enabled.
### Debug Shell
Enabling the `INVENTREE_DEBUG_SHELL` setting will allow the use of the [administrator shell](https://github.com/djk2/django-admin-shell). Note that this setting is only available if `INVENTREE_DEBUG` is also enabled, and is only accessible to superuser accounts.
### Database Logging
Enabling the `INVENTREE_DB_LOGGING` setting will log all database queries to the terminal. This can be useful for debugging database-related issues.
## Server Access
Depending on how your InvenTree installation is configured, you will need to pay careful attention to the following settings. If you are running your server behind a proxy, or want to adjust support for [CORS requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), one or more of the following settings may need to be adjusted.
@@ -106,12 +141,56 @@ Depending on how your InvenTree installation is configured, you will need to pay
| INVENTREE_CORS_ALLOW_CREDENTIALS | cors.allow_credentials | Allow cookies in cross-site requests | `True` |
| INVENTREE_COOKIE_SAMESITE | cookie.samesite | Session cookie mode. Must be one of `Strict | Lax | None`. Refer to the [mozilla developer docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie) for more information. | `None` |
| INVENTREE_COOKIE_SAMESITE | cookie.samesite | Session cookie mode. Must be one of `Strict | Lax | None | False`. Refer to the [mozilla developer docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie) and the [django documentation]({% include "django.html" %}/ref/settings/#std-setting-SESSION_COOKIE_SAMESITE) for more information. | False |
### Proxy Settings
### Debug Mode
Note that in [debug mode](./intro.md#debug-mode), some of the above settings are automatically adjusted to allow for easier development. The following settings are internally overridden in debug mode with the values specified below:
| Setting | Value in Debug Mode | Description |
| --- | --- | --- |
| `INVENTREE_ALLOWED_HOSTS` | `*` | Allow all host in debug mode |
| `CSRF_TRUSTED_ORIGINS` | Value is appended to allow `http://*.localhost:*` | Allow all connections from localhost, for development purposes |
| `INVENTREE_COOKIE_SAMESITE` | `False` | Disable all same-site cookie checks in debug mode |
| `INVENTREE_SESSION_COOKIE_SECURE` | `False` | Disable secure session cookies in debug mode (allow non-https cookies) |
### Cookie Settings
Note that if you set the `INVENTREE_COOKIE_SAMESITE` to `None`, then `INVENTREE_SESSION_COOKIE_SECURE` is automatically set to `True` to ensure that the session cookie is secure! This means that the session cookie will only be sent over secure (https) connections.
### Proxy Considerations
If you are running InvenTree behind a proxy, or forwarded HTTPS connections, you will need to ensure that the InvenTree server is configured to listen on the correct host and port. You will likely have to adjust the `INVENTREE_ALLOWED_HOSTS` setting to ensure that the server will accept requests from the proxy.
Additionally, you may need to configure the following header to ensure that the InvenTree server is watching for information forwarded by the proxy:
**X-Forwarded-Host**
By default, InvenTree *will not* look at the [X-Forwarded-Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host) header.
If you are running InvenTree behind a proxy which obscures the upstream host information, you will need to ensure that the `INVENTREE_USE_X_FORWARDED_HOST` setting is enabled. This will ensure that the InvenTree server uses the forwarded host header for processing requests.
You can also refer to the [Django documentation]({% include "django.html" %}/ref/settings/#secure-proxy-ssl-header) for more information on this header.
**X-Forwarded-Port**
InvenTree provides support for the `X-Forwarded-Port` header, which can be used to determine if the incoming request is using a forwarded port. If you are running InvenTree behind a proxy which forwards port information, you should ensure that the `INVENTREE_USE_X_FORWARDED_PORT` setting is enabled.
Note: This header is overridden by the `X-Forwarded-Host` header.
You can also refer to the [Django documentation]({% include "django.html" %}/ref/settings/#use-x-forwarded-port) for more information on this header.
**X-Forwarded-Proto**
InvenTree provides support for the [X-Forwarded-Proto](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto) header, which can be used to determine if the incoming request is using HTTPS, even if the server is running behind a proxy which forwards SSL connections. If you are running InvenTree behind a proxy which forwards SSL connections, you should ensure that the `INVENTREE_USE_X_FORWARDED_PROTO` setting is enabled.
You can also refer to the [Django documentation]({% include "django.html" %}/ref/settings/#use-x-forwarded-host) for more information on this header.
Proxy configuration can be complex, and any configuration beyond the basic setup is outside the scope of this documentation. You should refer to the documentation for the specific proxy server you are using.
Refer to the [proxy server documentation](./processes.md#proxy-server) for more information.
If you are running InvenTree behind another proxy, you will need to ensure that the InvenTree server is configured to listen on the correct host and port. You will likely have to adjust the `INVENTREE_ALLOWED_HOSTS` setting to ensure that the server will accept requests from the proxy.
## Admin Site
@@ -264,12 +343,12 @@ InvenTree requires some external directories for storing files:
This example removes the PUI banner and sets a login message. Take care of the double quotes.
If you want to remove the InvenTree branding as far as possible from your end-user also check the [global server settings](../settings/global.md#server-settings).
@@ -46,7 +46,7 @@ InvenTree run-time configuration options described in the [configuration documen
As docker containers are ephemeral, any *persistent* data must be stored in an external [volume](https://docs.docker.com/storage/volumes/). To simplify installation / implementation, all external data are stored in a single volume, arranged as follows:
#### Media FIles
#### Media Files
Uploaded media files are stored in the `media/` subdirectory of the external data volume.
@@ -87,7 +87,7 @@ Plugins are supported natively when running under docker. There are two ways to
The production docker compose configuration outlined on this page uses [Caddy](https://caddyserver.com/) to serve static files and media files. If you change this configuration, you will need to ensure that static and media files are served correctly.
!!! info "Read More"
Refer to the [Serving Files](./serving_files.md) section for more details
Refer to the [proxy server documentation](./processes.md#proxy-server) for more details
### SSL Certificates
@@ -99,45 +99,11 @@ The example docker compose file launches the following containers:
| Container | Description |
| --- | --- |
| inventree-db | PostgreSQL database |
| inventree-server | Gunicorn web server |
| inventree-worker | django-q background worker |
| inventree-proxy | Caddy file server and reverse proxy |
| *inventree-cache* | *redis cache (optional)* |
#### PostgreSQL Database
A PostgreSQL database container which requires a username:password combination (which can be changed). This uses the official [PostgreSQL image](https://hub.docker.com/_/postgres).
#### Web Server
Runs an InvenTree web server instance, powered by a Gunicorn web server.
#### Background Worker
Runs the InvenTree background worker process. This spins up a second instance of the *inventree* container, with a different entrypoint command.
#### Proxy Server
Caddy working as a reverse proxy, separating requests for static and media files, and directing everything else to Gunicorn.
This container uses the official [caddy image](https://hub.docker.com/_/caddy).
!!! info "Nginx Proxy"
An alternative is to run nginx as the reverse proxy. A sample configuration file is provided in the `./contrib/container/` source directory.
#### Redis Cache
Redis is used as cache storage for the InvenTree server. This provides a more performant caching system which can useful in larger installations.
This container uses the official [redis image](https://hub.docker.com/_/redis).
!!! info "Redis on Docker"
Docker adds an additional network layer - that might lead to lower performance than bare metal.
To optimize and configure your redis deployment follow the [official docker guide](https://redis.io/docs/getting-started/install-stack/docker/#configuration).
!!! tip "Enable Cache"
While a redis container is provided in the default configuration, by default it is not enabled in the Inventree server. You can enable redis cache support by following the [caching configuration guide](./config.md#caching)
@@ -146,6 +112,13 @@ InvenTree stores any persistent data (e.g. uploaded media files, database data,
!!! info "Data Directory"
Make sure you change the path to the local directory where you want persistent data to be stored.
#### Database Connection
The `inventree-db` container is configured to use the `postgres:13` docker image. The `inventree-server` and `inventree-worker` containers support connection to a postgres database up to (and including) version 15.
!!! warning "Newer Postgres Versions"
The InvenTree docker image supports connection to a postgres database up to version 15. Connecting to a database using a newer version of postgres is not possible.
You should now be able to view the InvenTree login screen at [http://inventree.localhost](http://inventree.localhost) (or whatever custom domain you have configured in the `.env` file).
@@ -199,10 +207,10 @@ Any persistent files generated by the Caddy container (such as certificates, etc
### Demo Dataset
To quickly get started with a demo dataset, you can run the following command:
To quickly get started with a [demo dataset](../demo.md), you can run the following command:
```
docker compose run --rm inventree-server invoke setup-test -i
docker compose run --rm inventree-server invoke dev.setup-test -i
```
This will install the InvenTree demo dataset into your instance.
@@ -210,7 +218,7 @@ This will install the InvenTree demo dataset into your instance.
To start afresh (and completely remove the existing database), run the following command:
```
docker compose run --rm inventree-server invoke delete-data
docker compose run --rm inventree-server invoke dev.delete-data
@@ -132,11 +136,14 @@ To update InvenTree run `apt install --only-upgrade inventree` - this might need
## Controlling InvenTree
### Services
InvenTree installs multiple services that can be controlled with your local system runner (`service` or `systemctl`).
The service `inventree` controls everything, `inventree-web` the (internal) webserver and `inventree-worker` the background worker(s).
The service `inventree` controls everything, `inventree-web`(the [InvenTree webserver](./processes.md#web-server)) and `inventree-worker` the [background worker(s)](./processes.md#background-worker).
More instances of the worker can be instantiated from the command line. This is only meant for advanced users.
This sample script launches 3 services. By default, 1 is launched.
@@ -29,30 +29,7 @@ Independent of the preferred installation method, InvenTree provides a number of
## System Components
The InvenTree server ecosystem consists of the following components:
### Database
A persistent database is required for data storage. By default, InvenTree is configured to use [PostgreSQL](https://www.postgresql.org/) - and this is the recommended database backend to use. However, InvenTree can also be configured to connect to any database backend [supported by Django]({% include "django.html" %}/ref/databases/)
### Web Server
The bulk of the InvenTree code base supports the custom web server application. The web server application services user requests and facilitates database access. The webserver provides access to the [API](../api/api.md) for performing database query actions.
InvenTree uses [Gunicorn](https://gunicorn.org/) as the web server - a Python WSGI HTTP server.
### Background Tasks
A separate application handles management of [background tasks](../settings/tasks.md), separate to user-facing web requests. The background task manager is required to perform asynchronous tasks, such as sending emails, generating reports, and other long-running tasks.
InvenTree uses [django-q2](https://django-q2.readthedocs.io/en/master/) as the background task manager.
### File Storage
Uploaded *media* files (images, attachments, reports, etc) and *static* files (javascript, html) are stored to a persistent storage volume. A *file server* is required to serve these files to the user.
InvenTree uses [Caddy](https://caddyserver.com/) as a file server, which is configured to serve both *static* and *media* files. Additionally, Caddy provides SSL termination and reverse proxy services.
The InvenTree software stack is composed of multiple components, each of which is required for a fully functional server environment. Your can read more about the [InvenTree processes here](./processes.md).
## OS Requirements
@@ -70,25 +47,7 @@ InvenTree requires a minimum Python version of {{ config.extra.min_python_versio
### Invoke
InvenTree makes use of the [invoke](https://www.pyinvoke.org/) python toolkit for performing various administrative actions.
!!! warning "Invoke Version"
InvenTree requires invoke version {{ config.extra.min_invoke_version }} or newer. Some platforms may be shipped with older versions of invoke!
!!! tip "Updating Invoke"
To update your invoke version, run `pip install -U invoke`
To display a list of the available InvenTree administration actions, run the following commands from the top level source directory:
```
invoke --list
```
This provides a list of the available invoke commands - also displayed below:
```
{{ invoke_commands() }}
```
InvenTree makes use of the [invoke](https://www.pyinvoke.org/) python toolkit for performing various administrative actions. You can read [more about out use of the invoke tool here](./invoke.md)
### Virtual Environment
@@ -109,7 +68,7 @@ python3 -m venv env
The virtual environment needs to be activated to ensure the correct python binaries and libraries are used. The InvenTree instructions assume that the virtual environment is always correctly activated.
To configure Inventree inside a virtual environment, ``cd`` into the inventree base directory and run the following command:
To configure InvenTree inside a virtual environment, ``cd`` into the inventree base directory and run the following command:
```
source env/bin/activate
@@ -150,4 +109,4 @@ So, for a production setup, you should set `INVENTREE_DEBUG=false` in the [confi
Turning off DEBUG mode creates further work for the system administrator. In particular, when running in DEBUG mode, the InvenTree web server natively manages *static* and *media* files, which means that the InvenTree server can run "monolithically" without the need for a separate web server.
!!! info "Read More"
Refer to the [Serving Files](./serving_files.md) section for more details
Refer to the [proxy server documentation](./processes.md#proxy-server) for more details
InvenTree uses the [invoke](https://www.pyinvoke.org/) tool to manage various system administration tasks. Invoke is a powerful python-based task execution tool, which allows for the creation of custom tasks and command-line utilities.
### Installation
InvenTree setup and administration requires that the invoke tool is installed. This is usually installed automatically as part of the InvenTree installation process - however (if you are configuring InvenTree from source) you may need to install it manually.
To install the invoke tool, run the following command:
```
pip install -U invoke
```
### Minimum Version
The minimum required version of the invoke tool is `{{ config.extra.min_invoke_version }}`.
To determine the version of invoke you have installed, run either:
```
invoke --version
```
```
python -m invoke --version
```
If you are running an older version of invoke, ensure it is updated to the latest version:
```
pip install -U invoke
```
### Running from Command Line
To run the `invoke` tool from the command line, you must be in the top-level InvenTree source directory. This is the directory that contains the [tasks.py]({{ sourcefile("tasks.py") }}) file.
### Running in Docker Mode
If you have installed InvenTree via [docker](./docker_install.md), then you need to ensure that the `invoke` commands are called from within the docker container context.
For example, to run the `update` task, you might use the following command to run the `invoke` command - using the `docker compose` tool.
```
docker compose run --rm inventree-server invoke update
```
!!! note "Docker Compose Directory"
The `docker compose` command should be run from the directory where the `docker-compose.yml` file is located.
Alternatively, to manually run the command within the environment of the running docker container:
```
docker exec -it inventree-server invoke update
```
!!! note "Container Name"
The container name may be different depending on how you have configured the docker environment.
### Running in Installer Mode
If you have installed InvenTree using the [package installer](./installer.md), then you need to prefix all `invoke` commands with `inventree run`.
For example, to run the `update` task, use:
```
inventree run invoke update
```
## Available Tasks
To display a list of the available InvenTree administration actions, run the following commands from the top level source directory:
```
invoke --list
```
This provides a list of the available invoke commands - also displayed below:
```
{{ invoke_commands() }}
```
### Task Information
Each task has a brief description of its purpose, which is displayed when running the `invoke --list` command. To find more detailed information about a specific task, run the command with the `--help` flag.
For example, to find more information about the `update` task, run:
```
invoke update --help
```
### Internal Tasks
Tasks with the `int.` prefix are internal tasks, and are not intended for general use. These are called by other tasks, and should generally not be called directly.
### Developer Tasks
Tasks with the `dev.` prefix are tasks intended for InvenTree developers, and are also not intended for general use.
## Common Issues
Below are some common issues that users may encounter when using the `invoke` tool, and how to resolve them.
### Command 'invoke' not found
If the `invoke` command does not work, it means that the invoke tool has not been [installed correctly](#installation).
### Invoke Version
If the installed version of invoke is too old, users may see error messages during the installation procedure, such as:
- *'update' did not receive all required positional arguments!*
- *Function has keyword-only arguments or annotations*
Ensure that the installed version of invoke is [up to date](#minimum-version).
### Can't find any collection named 'tasks'
It means that the `invoke` tool is not able to locate the InvenTree task collection.
- If running in docker, ensure that you are running the `invoke` command from within the [docker container](#running-in-docker-mode)
- If running in installer mode, ensure that you are running the `invoke` command with the [correct prefix](#running-in-installer-mode)
- If running via command line, ensure that you are running the `invoke` command from the [correct directory](#running-from-command-line)
This step ensures that the required database tables exist, and are at the correct schema version, which must be the case before data can be imported.
### Import Data
The new database should now be correctly initialized with the correct table structures required to import the data. Run the following command to load the databased dump file into the new database.
If the character encoding of the data file does not exactly match the target database, the import operation may not succeed. In this case, some manual editing of the database JSON file may be required.
### Copy Media Files
Any media files (images, documents, etc) that were stored in the original database must be copied to the new database. In a typical InvenTree installation, these files are stored in the `media` subdirectory of the InvenTree data location.
Copy the entire directory tree from the original InvenTree installation to the new InvenTree installation.
!!! warning "File Ownership"
Ensure that the file ownership and permissions are correctly set on the copied files. The InvenTree server process **must** have read / write access to these files. If not, the server will not be able to serve the media files correctly, and the user interface may not function as expected.
!!! warning "Directory Structure"
The expected locations of each file is stored in the database, and if the file paths are not correct, the media files will not be displayed correctly in the user interface. Thus, it is important that the files are transferred across to the new installation in the same directory structure.
## Migrating Data to Newer Version
If you are updating from an older version of InvenTree to a newer version, the migration steps outlined above *do not apply*.
InvenTree is a complex application, and there are a number of processes which must be running in order for the system to operate correctly. Typically, these processes are started automatically when the InvenTree application stack is launched. However, in some cases, it may be necessary to start these processes manually.
System administrators should be aware of the following processes when configuring an InvenTree installation:
### Database
At the core of the InvenTree application is the SQL database. The database is responsible for storing all of the persistent data which is used by the InvenTree application.
InvenTree supports a [number of database backends]({% include "django.html" %}/ref/databases) - which typically require their own process to be running.
Refer to the [database configuration guide](./config.md#database-options) for more information on selecting and configuring the database backend.
In running InvenTree via [docker compose](./docker_install.md), the database process is managed by the `inventree-db` service which provides a [Postgres docker container](https://hub.docker.com/_/postgres).
### Web Server
The InvenTree web server is responsible for serving the InvenTree web interface to users. The web server is a [Django](https://www.djangoproject.com/) application, which is run using the [Gunicorn](https://gunicorn.org/) WSGI server.
The web server interfaces with the backend database and provides a [REST API](../api/api.md) (via the [Django REST framework](https://www.django-rest-framework.org/)) which is used by the frontend web interface.
In running InvenTree via [docker compose](./docker_install.md), the web server process is managed by the `inventree-server` service, which runs from a custom docker image.
### Proxy Server
In a production installation, the InvenTree web server application *does not* provide hosting of static files, or user-uploaded (media) files. Instead, these files should be served by a separate web server, such as [Caddy](https://caddyserver.com/), [Nginx](https://www.nginx.com/), or [Apache](https://httpd.apache.org/).
!!! info "Debug Mode"
When running in [production mode](./bare_prod.md) (i.e. the `INVENTREE_DEBUG` flag is disabled), a separate web server is required for serving *static* and *media* files. In `DEBUG` mode, the django webserver facilitates delivery of *static* and *media* files, but this is explicitly not suitable for a production environment.
!!! tip "Read More"
You can find further information in the [django documentation]({% include "django.html" %}/howto/static-files/deployment/).
A proxy server is required to store and serve static files (such as images, documents, etc) which are used by the InvenTree application. As django is not designed to serve static files in a production environment, a separate file server is required. For our docker compose setup, we use the `inventree-proxy` service, which runs a [Caddy](https://caddyserver.com/) proxy server to serve static files.
In addition to serving static files, the proxy server also provides a reverse proxy to the InvenTree web server, allowing the InvenTree web interface to be accessed via a standard HTTP/HTTPS port.
Further, it provides an authentication endpoint for accessing files in the `/static/` and `/media/` directories.
Finally, it provides a [Let's Encrypt](https://letsencrypt.org/) endpoint for automatic SSL certificate generation and renewal.
### Proxy Functionality
#### API and Web Requests
All API and web requests are reverse-proxied to the InvenTree django server. This allows the InvenTree web server to be accessed via a standard HTTP/HTTPS port, and allows the proxy server to handle SSL termination.
#### Static Files
Static files can be served without any need for authentication. In fact, they must be accessible *without* authentication, otherwise the unauthenticated views (such as the login screen) will not function correctly.
#### Media Files
It is highly recommended that the *media* files are served behind an authentication layer. This is because the media files are user-uploaded, and may contain sensitive information. Most modern web servers provide a way to serve files behind an authentication layer.
### Proxy Configuration
We provide some *sample* configuration files for getting your proxy server off the ground. The exact setup and configuration of your proxy server will depend on your specific requirements, and the software you choose to use. You may be integrating InvenTree with an existing web server, and the configuration may be different to the provided examples.
#### Example Configurations
**Caddy**
The [docker production example](./docker.md) provides an example using [Caddy](https://caddyserver.com) to serve *static* and *media* files, and redirecting other requests to the InvenTree web server itself. Caddy is a modern web server which is easy to configure and provides a number of useful features, including automatic SSL certificate generation.
You can find the sample Caddy configuration [here]({{ sourcefile("contrib/container/Caddyfile") }}).
**Nginx**
An alternative is to run nginx as the reverse proxy. A sample configuration file is provided [here]({{ sourcefile("contrib/container/nginx.conf") }}).
#### Extending the Proxy Configuration
You may wish to extend the proxy configuration to include additional features, based on your particular requirements. Some examples of where additional configuration may be required include:
- **Upstream Proxy**: You may be running the InvenTree server behind another proxy server, and need to configure the proxy server to forward requests to the upstream proxy.
- **Authentication**: You may wish to add an authentication layer to the proxy server, to restrict access to the InvenTree web interface.
- **SSL Termination**: You may wish to terminate SSL connections at the proxy server, and forward unencrypted traffic to the InvenTree web server.
- **Load Balancing**: You may wish to run multiple instances of the InvenTree web server, and use the proxy server to load balance between them.
- **Custom Error Pages**: You may wish to provide custom error pages for certain HTTP status codes.
!!! warning "No Support"
We do not provide support for configuring your proxy server. The configuration of the proxy server is outside the scope of this documentation. If you require assistance with configuring your proxy server, please refer to the documentation for the specific software you are using.
#### Integrating with Existing Proxy
You may wish to integrate the InvenTree web server with an existing reverse proxy server. This is possible, but requires careful configuration to ensure that the static and media files are served correctly.
*Note: A custom configuration of the proxy server is outside the scope of this documentation!*
### Background Worker
The InvenTree background worker is responsible for handling [asynchronous tasks](../settings/tasks.md) which are not suitable for the main web server process. This includes tasks such as sending emails, generating reports, and other long-running tasks.
InvenTree uses the [django-q2](https://django-q2.readthedocs.io/en/master/) package to manage background tasks.
The background worker process is managed by the `inventree-worker` service in the [docker compose](./docker_install.md) setup. Note that this services runs a duplicate copy of the `inventree-server` container, but with a different entrypoint command which starts the background worker process.
#### Important Information
If the background worker process is not running, InvenTree will not be able to perform background tasks. This can lead to issues such as emails not being sent, or reports not being generated. Additionally, certain data may not be updated correctly if the background worker is not running.
!!! warning "Background Worker"
The background worker process is a critical part of the InvenTree application stack. It is important that this process is running correctly in order for the InvenTree application to operate correctly.
#### Limitations
If the [cache server](#cache-server) is not running, the background worker will be limited to running a single threaded worker. This is because the background worker uses the cache server to manage task locking, and without a global cache server to communicate between processes, concurrency issues can occur.
### Cache Server
The InvenTree cache server is used to store temporary data which is shared between the InvenTree web server and the background worker processes. The cache server is also used to store task information, and to manage task locking between the background worker processes.
Using a cache server can significantly improve the performance of the InvenTree application, as it reduces the need to query the database for frequently accessed data.
InvenTree uses the [Redis](https://redis.io/) cache server to manage cache data. When running in docker, we use the official [redis image](https://hub.docker.com/_/redis).
!!! info "Redis on Docker"
Docker adds an additional network layer - that might lead to lower performance than bare metal.
To optimize and configure your redis deployment follow the [official docker guide](https://redis.io/docs/getting-started/install-stack/docker/#configuration).
!!! tip "Enable Cache"
While a redis container is provided in the default configuration, by default it is not enabled in the InvenTree server. You can enable redis cache support by following the [caching configuration guide](./config.md#caching)
In a production installation, the InvenTree web server application *does not* provide hosting of static files, or user-uploaded (media) files. Instead, these files should be served by a separate web server, such as [Caddy](https://caddyserver.com/), [Nginx](https://www.nginx.com/), or [Apache](https://httpd.apache.org/).
!!! info "Debug Mode"
When running in [production mode](./bare_prod.md) (i.e. the `INVENTREE_DEBUG` flag is disabled), a separate web server is required for serving *static* and *media* files. In `DEBUG` mode, the django webserver facilitates delivery of *static* and *media* files, but this is explicitly not suitable for a production environment.
!!! tip "Read More"
You can find further information in the [django documentation]({% include "django.html" %}/howto/static-files/deployment/).
There are *many* different ways that a sysadmin might wish to handle this - and it depends on your particular installation requirements.
### Static Files
Static files can be served without any need for authentication. In fact, they must be accessible *without* authentication, otherwise the unauthenticated views (such as the login screen) will not function correctly.
### Media Files
It is highly recommended that the *media* files are served behind an authentication layer. This is because the media files are user-uploaded, and may contain sensitive information. Most modern web servers provide a way to serve files behind an authentication layer.
### Example Configuration
The [docker production example](./docker.md) provides an example using [Caddy](https://caddyserver.com) to serve *static* and *media* files, and redirecting other requests to the InvenTree web server itself.
Caddy is a modern web server which is easy to configure and provides a number of useful features, including automatic SSL certificate generation.
@@ -18,6 +18,19 @@ If there are some icons missing in the tabler icons package, users can even inst
A stock location type represents a specific type of location (e.g. one specific size of drawer, shelf, ... or box) which can be assigned to multiple stock locations. In the first place, it is used to specify an icon and having the icon in sync for all locations that use this location type, but it also serves as a data field to quickly see what type of location this is. It is planned to add e.g. drawer dimension information to the location type to add a "find a matching, empty stock location" tool.
## External Stock Location
An external stock location can be used to indicate that items in there might not be available
for immediate usage. Stock items in an external location are marked with an additional icon
in the build order line items view where the material is allocated.
{% with id="stock_external_icon", url="stock/stock_external_icon.png", description="External stock indication" %}
{% include 'img.html' %}
{% endwith %}
Anyhow there is no limitation on the stock item. It can be allocated as usual.
The external flag does not get inherited to sublocations.
## Stock Item
A *Stock Item* is an actual instance of a [*Part*](../part/part.md) item. It represents a physical quantity of the *Part* in a specific location.
Stock items which are associated with a *trackable* part can have associated test data - this is particularly useful for tracking unit testing / commissioning / acceptance data against a serialized stock item.
Stock items which are associated with a [testable part](../part/part.md#testable) can have associated test data - this is particularly useful for tracking unit testing / commissioning / acceptance data against a serialized stock item.
The master "Part" record for the stock item can define multiple [test templates](../part/test.md), against which test data can be uploaded. Additionally, arbitrary test information can be assigned to the stock item.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.