* Add basic task for generating apidocs
* Fix SPECTACTULAR_SETTINGS
- Some provided options were not correct
* Update .gitignore
* Fix for duplicated API path
- `/api/plugins/activate` routed to PluginActivate view
- Must be associated with a specific plugin ID
* By default, fail if warnings are raised
* Use GenericAPIView for GetAuthToken
* Use GenericAPIView for RolesDetail endpoint
* Refactor more endpoints to use GenericApiView
* More API cleanup
* Add extra type hints for exposed methods
* Update RoleDetails endpoint
- Specify serializer
- Use RetrieveAPI class type
* More type hints
* Export API docs as part of CI
* add more api views docs
* even more docs
* extend tests to api-version
* simplify serializer
* and more docs
* fix serializer
* added more API docs
* clean diff
* Added APISearch base
* do not assume you know the user
he might be anonymously creating the schema ;-)
* set empty serializer where no input is needed
* Use dummy model for schema generation
* fix OpenAPI docs section
* Update .github/workflows/qc_checks.yaml
Co-authored-by: Matthias Mair <code@mjmair.com>
* REmove duplicate commands
* Ignore warnings in CI
---------
Co-authored-by: Matthias Mair <code@mjmair.com>
* Use registry.get_plugin()
- Instead of registry.plugins.get()
- get_plugin checks registry hash
- performs registry reload if necessary
* Add PluginValidationMixin class
- Allows the entire model to be validated via plugins
- Called on model.full_clean()
- Called on model.save()
* Update Validation sample plugin
* Fix for InvenTreeTree models
* Refactor build.models
- Expose models to plugin validation
* Update stock.models
* Update more models
- common.models
- company.models
* Update more models
- label.models
- order.models
- part.models
* More model updates
* Update docs
* Fix for potential plugin edge case
- plugin slug is globally unique
- do not use get_or_create with two lookup fields
- will throw an IntegrityError if you change the name of a plugin
* Inherit DiffMixin into PluginValidationMixin
- Allows us to pass model diffs through to validation
- Plugins can validate based on what has *changed*
* Update documentation
* Add get_plugin_config helper function
* Bug fix
* Bug fix
* Update plugin hash when calling set_plugin_state
* Working on unit testing
* More unit testing
* Move get_plugin_config into registry.py
* Move extract_int into InvenTree.helpers
* Fix log formatting
* Update model definitions
- Ensure there are no changes to the migrations
* Comment out format line
* Fix access to get_plugin_config
* Fix tests for SimpleActionPlugin
* More unit test fixes
* bump to dj >4.2
* switch to experimental git release
* bump django-import_export
* bump mptt
* replace is_ajax, which was removed
https://docs.djangoproject.com/en/3.1/releases/3.1/#id2
* Save before accessing values in m2m/fk fields
* move plugin init
* use dev version of django for fix
* update deps
* fix deps
* use django smaller 4.2
* fix reqs
* fix merge
* remove moved code
* another merge fix
* fix ajax call
* fix refs
* change python min v
* fix deps
* bump deps
* fix deps
* pin pillow
* dj 4.1 upgrades
* make diff smaller
* bump all deps
* drop down to py3.9
* bump versions
* merge fix
* fix diff
* more bumping
* diff cleanup
* bump deps
* fix reqs
* use accurate state for model migrations
using apps the historically correct state is used
* try import
* added more logs
* add try here too
* clean up rebuilds
* Dj 4.2 (#161)
* autochanges
* bump
* fix diff
* fix diff
* bump deps
* fix req
* remove select_related to test error influence
* switch to mptt fork
* fix reqs for upstream
* move tracking ensureance into save
* optimize check frequency
* use psycopg instead of psycopg2
* fix header
* just use the values
* switch to dj < 4.2
* fix req
* another req fix
* switch to 4.2 again
* fix merge error
* Check for null pk in calculate_total_price
Cannot access self.lines if pk is Null
* use patched mptt
* try psycopg2 again
* Remove tree rebuild from migrations
* Prevent notify_users if importing or migrating
* Add order_by() to subquery annotations
- Ref: https://stackoverflow.com/a/629691
* Update stock filters
- Append order_by()
* fix error if running without timezones in testing
* add logging to figure this out
* remove tz from self.creation if TZ is off
* add tz?
* move around?
* only run the test i am trying to figure out
not reproducible on my machine
* only run the test i am trying to figure out
not reproducible on my machine
* run all tests again
---------
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
* Add child stock item table
* Fix stock item splitting bug
- StockItem tree was not being rebuilt correctly
- Add unit tests
* Annotate StockItem serializer with "child_items" count
* Show or hide "child items" panel
* Account for case where tree_id is zero
* Revert {% jstrans %} for .js files
- file extension is enough
* Remove custom jstrans templatetag
* Replace jstrans calls for .html files
- Add "escape=True"
* Allow for custom "escape" argument
* Update custom trans tag
- Cannot pass kwargs in the same way
- Add the "escape" attribute
* Update js translations in html files
* move more paths to basic path
* changed url route to only match fully - fixed test
* revert path changes on labelprint pages
* fix not found/redirect
* revert test change
* Bug fix for BarcodePOReceive endpoint
- Existing scan must match "stockitem" to raise an error
* bug fix: barcode.js
- Handle new return data from barcode scan endpoint
* Add barcode endpoint for allocating stock to sales order
* Improve logic for preventing over allocation of stock item to sales order
* Test for sufficient quantity
* Bump API version
* Bug fix and extra check
* Cleanup unit tests
* Add unit testing for new endpoint
* Add blank page for app sales orders docs
* Add docs for new barcode features in app
* Fix unit tests
* Remove debug statement
* Fix "company" filter for StockList
- distinct() was in the wrong spot
- Added a new unit test to cover this
* Update stocklist API filter
- Move custom filtering into FilterSet class
- Exposes available filters to API documentation
- Improved readability / field validation
* Further improvements for StockList API
* For for order extra line item serializer
- 'title' is not a valid field
* Remove stat context variables
* Revert "Remove stat context variables"
This reverts commit 0989c308d0cea9b9405a1338d257b542c6d33d73.
* Allow longer timeout for image download tests
* fix: Adding specific quantity of a part as installed item(s
* fix: Adding specific quantity of a part as installed item(s
* Update serializers.py
* Mark field as not required
* If value not provided, revert to "default" behavior
* Fix serializer validation
* Update frontend forms to mach
* Bump API version
---------
Co-authored-by: Ulugbek Erkinov <ulugbekerkinov606@gmail.com>
* Replace moneyed format_money function
* Update django-money to 3.3.0 and py-moneyed to 3.0
* Add CurrencyField migrations
* Fix checking if decimal_places is set
* Add currency formatting test
* Test fixing deepsource test patterns
* Revert "Test fixing deepsource test patterns"
This reverts commit 398ef93cd64e76f0a2b8b84ad73fed494a49d3f6.
* FIx requirements.txt formatting
* Revert "FIx requirements.txt formatting"
This reverts commit bb554b07582379f3817b60862c07f726fae6e8ea.
* Improve deletion behaviour for InvenTreeTree model
- Remove recursive call to function
- Handle database operations as bulk queries
- Ensure child nodes have their pathstring updated correctly
- Remove old @receiver hook
- Refactor StockLocation.delete method
- Refactor PartCategory.delete method
- Atomic transactions potentially problematic here
* Add docstring
* Fix method name
* Use bulk-update instead of recursive save when pathstring changes
* Improvements for tree delete method
- Handle case where item has already been deleted
* Raise exception rather than simply logging
* Update unit tests
* Improvements to unrelated unit test
* Fix urls.md
* Fix typo
The use of `else` or `elif` becomes redundant and can be dropped if the last statement under the leading `if` / `elif` block is a `return` statement.
In the case of an `elif` after `return`, it can be written as a separate `if` block.
For `else` blocks after `return`, the statements can be shifted out of `else`. Please refer to the examples below for reference.
Refactoring the code this way can improve code-readability and make it easier to maintain.
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
To check if a variable is equal to one of many values, combine the values into a tuple and check if the variable is contained `in` it instead of checking for equality against each of the values.
This is faster, less verbose, and more readable.
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
There shouldn't be any blank lines after the function docstring.
Remove the blank lines to fix this issue.
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
* Added model changes for StockLocationTypes
* Implement icon for CUI
* Added location type to location table with filters
* Fix ruleset
* Added tests
* Bump api version to v136
* trigger: ci
* Bump api version variable too
* Show only the current modal over the backdrop, move others behind
* Added initial draft for tree picker
* Added filters to tree picker
* Added tree picker to more location fields
* Fixed bug with missing input group and filters side effect
* Added tree picker to part category inputs
* Added missing picker for part category parent input
* Fixed disabled items
* Fix js linting errors
* trigger: ci
* Bump api_version.py
* Update api_version.py
* Add "path_detail" to stock location serializer
- Requires ?path_detail=1 in URL query parameters
- Only avaialable on the StockLocation detail URL endpoint (not list, too expensive)
* Implement path_detail option for PartCategory detail API endpoint
* Add "path_detail" option to PartSerializer
* Add optional path_detail to StockItem serializer
* Cleanup
* Increment API version
* Add unit test for Part and PartCategory
* Remove debug statement
* Basic AttachmentTable
* Add form for editing an attachment
* Fix columns for InvenTreeTable component
* Update part attachment table
* Add dropzone to attachments table
* Handle file upload with Dropzone
* Add header for panelgroup
* Improve rendering of attachment files
* Allow various attachment list API endpoints to be searched
* Determine available attachment actions based on user permissions
* Reload attachment table after upload
* Delete attachments via table
* ts fix
* Clip width of actions column
* More updates
- Add manual buttons for adding link or file
- Edit link or file
* Add tooltip for row actions
* Adds a custom hook for refreshing tables
- So much cleaner :)
* Change export type
* Disable row action column when checkbox selection is active
* Fix(?) for custom hook
* Badge tweak
* Add extra API fields when performing stock adjustments
* Make optional fields actually optional
* Update API version
* Allow usage of optional fields when transferring stock items
* Update api_version.py
* Annotate available variant stock to SalesOrderLine serializer
* Filter variant stock by:
- active = True
- salable = True
* Add 'salable' filter to StockList API
* Filter available stock in sales order table:
- Must be salable
- Must be active
* Update table display
* Bump API version
* Fix range filtering for serial number
- Needs to point to "serial_int" field to work
* Bump API version
(cherry picked from commit c3cb47ec15bbba1bf5d6d46374ac29b627f5bf34)
* add report feature for stock locations
* fix flake 8 errors
* run pre-commit run --all-files to fix style errors
* add new model
* create default stock location
* Add generic implementation for barcode actions
- Commonize code against tables
- Cleaner UI
- Better code
- Will make future react refactor easier
* Add permissions.js
- Separate .js file for dynamically checking permissions
* Update stock table to use client-side actions
* API endpoint for bulk category adjustment
* Bug fix for purchase_order.js
- Prevent some really strange API calls
* Refactor actions for part table
- Now done dynamically
* Refactor actions for the attachment tables
* Refactor actions for build output table
* Increment API version
* Cleanup janky button
* Refactor supplier part table
* Refactor manufacturer part table
* Remove linkButtonsToSelection
- no longer needed
- Cleanup, yay!
* Cleanup purchase order line table
* Refactor BOM table buttons
* JS linting
* Further cleanup
* Template cleanup
- remove extra div elements
* js linting
* js fix