* Made the description field on the part model optional
* Made the title field on the build model optional
* Made the description field on the order model optional
* Added migration files
* Update data migration file
- Do not call "save()" on the ORM model as it has some other hooks
- Manually calculate checksum to determine which line items are "valid"
- Update BomItem checksum calculation
* Update BomItem hashing function
- Ensure it remains the same after saving
- Must use normalize(quantity) otherwise weird issues
* Add barcode support to external orders
- ReturnOrder
- PurchaseOrder
- SalesOrder
* Support scanning for new model types
* Integrate UI elements for ReturnOrder
* Update PurchaseOrder page
* SalesOrder implementation
* Adds custom search filter to allow 'regex' searching of results
* Specify if "shell" can access database for certain commands
* Bug fix for settings API
- Do not allow cache on detail endpoints
- Was causing strange error conditions with missing or duplicate PK values
* Adds user setting to control regex search
* Enable regex for search queries
- bootstrap tables
- search preview
* Pass search options through bettererer
* Refactor API endpoints to use new filter approach
* Bump API version
* Add "whole word" search
- Closes https://github.com/inventree/InvenTree/issues/4510
* Handle case where existing fields are empty
* pop > get
* Adds ReturnOrder and ReturnOrderAttachment models
* Adds new 'role' specific for return orders
* Refactor total_price into a mixin
- Required for PurchaseOrder and SalesOrder
- May not be required for ReturnOrder (remains to be seen)
* Adds API endpoints for ReturnOrder
- Add list endpoint
- Add detail endpoint
- Adds required serializer models
* Adds basic "index" page for Return Order model
* Update API version
* Update navbar text
* Add db migration for new "role"
* Add ContactList and ContactDetail API endpoints
* Adds template and JS code for manipulation of contacts
- Display a table
- Create / edit / delete
* Splits order.js into multiple files
- Javascript files was becoming extremely large
- Hard to debug and find code
- Split into purchase_order / return_order / sales_order
* Fix role name (change 'returns' to 'return_order')
- Similar to existing roles for purchase_order and sales_order
* Adds detail page for ReturnOrder
* URL cleanup
- Use <int:pk> instead of complex regex
* More URL cleanup
* Add "return orders" list to company detail page
* Break JS status codes into new javascript file
- Always difficult to track down where these are rendered
- Enough to warrant their own file now
* Add ability to edit return order from detail page
* Database migrations
- Add new ReturnOrder modeles
- Add new 'contact' field to external orders
* Adds "contact" to ReturnOrder
- Implement check to ensure that the selected "contact" matches the selected "company"
* Adjust filters to limit contact options
* Fix typo
* Expose 'contact' field for PurchaseOrder model
* Render contact information
* Add "contact" for SalesOrder
* Adds setting to enable / disable return order functionality
- Simply hides the navigation elements
- API is not disabled
* Support filtering ReturnOrder by 'status'
- Refactors existing filter into the OrderFilter class
* js linting
* More JS linting
* Adds ReturnOrderReport model
* Add serializer for the ReturnOrderReport model
- A little bit of refactoring along the way
* Admin integration for new report model
* Refactoring for report.api
- Adds generic mixins for filtering queryset (based on updates to label.api)
- Reduces repeated code a *lot*
* Exposes API endpoints for ReturnOrderReport
* Adds default example report file for ReturnOrder
- Requires some more work :)
* Refactor report printing javascript code
- Replace all existing functions with 'printReports'
* Improvements for default StockItem test report template
- Fix bug in template
- Handle potential errors in template tags
- Add more helpers to report tags
- Improve test result rendering
* Reduce logging verbosity from weasyprint
* Refactor javascript for label printing
- Consolidate into a single function
- Similar to refactor of report functions
* Add report print button to return order page
* Record user reference when creating via API
* Refactor order serializers
- Move common code into AbstractOrderSerializer class
* Adds extra line item model for the return order
- Adds serializer and API endpoints as appropriate
* Render extra line table for return order
- Refactor existing functions into a single generic function
- Reduces repeated JS code a lot
* Add ability to create a new extra line item
* Adds button for creating a new lien item
* JS linting
* Update test
* Typo fix
(cherry picked from commit 28ac2be35b)
* Enable search for return order
* Don't do pricing (yet) for returnorder extra line table
- Fixes an uncaught error
* Error catching for api.js
* Updates for order models:
- Add 'target_date' field to abstract Order model
- Add IN_PROGRESS status code for return order
- Refactor 'overdue' and 'outstanding' API queries
- Refactor OVERDUE_FILTER on order models
- Refactor is_overdue on order models
- More table filters for return order model
* JS cleanup
* Create ReturnOrderLineItem model
- New type of status label
- Add TotalPriceMixin to ReturnOrder model
* Adds an API serializer for the ReturnOrderLineItem model
* Add API endpoints for ReturnOrderLineItem model
- Including some refactoring along the way
* javascript: refactor loadTableFilters function
- Pass enforced query through to the filters
- Call Object.assign() to construct a superset query
- Removes a lot of code duplication
* Refactor hard-coded URLS to use {% url %} lookup
- Forces error if the URL is wrong
- If we ever change the URL, will still work
* Implement creation of new return order line items
* Adds 'part_detail' annotation to ReturnOrderLineItem serializer
- Required for rendering part information
* javascript: refactor method for creating a group of buttons in a table
* javascript: refactor common buttons with helper functions
* Allow edit and delete of return order line items
* Add form option to automatically reload a table on success
- Pass table name to options.refreshTable
* JS linting
* Add common function for createExtraLineItem
* Refactor loading of attachment tables
- Setup drag-and-drop as part of core function
* CI fixes
* Refactoring out some more common API endpoint code
* Update migrations
* Fix permission typo
* Refactor for unit testing code
* Add unit tests for Contact model
* Tests for returnorder list API
* Annotate 'line_items' to ReturnOrder serializer
* Driving the refactor tractor
* More unit tests for the ReturnOrder API endpoints
* Refactor "print orders" button for various order tables
- Move into "setupFilterList" code (generic)
* add generic 'label printing' button to table actions buttons
* Refactor build output table
* Refactoring icon generation for js
* Refactoring for Part API
* Fix database model type for 'received_date'
* Add API endpoint to "issue" a ReturnOrder
* Improvements for stock tracking table
- Add new status codes
- Add rendering for SalesOrder
- Add rendering for ReturnOrder
- Fix status badges
* Adds functionality to receive line items against a return order
* Add endpoints for completing and cancelling orders
* Add option to allow / prevent editing of ReturnOrder after completed
* js linting
* Wrap "add extra line" button in setting check
* Updates to order/admin.py
* Remove inline admin for returnorderline model
* Updates to pass CI
* Serializer fix
* order template fixes
* Unit test fix
* Fixes for ReturnOrder.receive_line_item
* Unit testing for receiving line items against an RMA
* Improve example report for return order
* Extend unit tests for reporting
* Cleanup here and there
* Unit testing for order views
* Clear "sales_order" field when returning against ReturnOrder
* Add 'location' to deltas when returning from customer
* Bug fix for unit test
* Add metadata for ManufacturerPart
* Add Metadata for SupplierPart
* Add metadata to label models
* Add metadata to order line items
* Add metadata to shipment
* Add metadata to Build and BuildItem
* Add metadata to BomItem
* Add metadata to PartParameterTemplate
* Syntax, lint
* Fix isort style
* Lint
* Correction of model name
* Metadata for Reports
* Fix silly error
* Fix silly error
* Correct model name
* Correct model name
* Correction
* Correct company urls
* Apply generic model to Report metadat
* Rename/remove redundant import
* Remove shadowing of report in loop variable
* Update import ordering
* More corrections
* better docstrings
* Correct names for API endpoints
* Default to PO, required for api-doc to work
* Changes by @matmair
* Suppress metadata from Bom export
* Add migration files
* Increment API version
* Add tests for all Metadata models, even previously existing ones
* Update tests
* Fix
* Delay tests
* Fix imports
* Fix tests
* API Version number
* Remove unused import
* isort
* Revent unintended change of cache
* Bypass cache when displaying settings on "settings" page
- Sometimes caching issues can cause "old" values to be stored (depends on the worker)
- Until we have a shared cache, this is a problem
- Force the settings to be re-loaded from the database when displaying
- Further improvement would be to render them via the API
* Bypass cache for report and label printing
* Update test
(cherry picked from commit 18c7c1d756)
* Adds setting to enable / disable revision field
* Optionally hide revision field from part forms
* Hide revision informatoin on part page
* Bug fix for part variant table
- Use existing full_name variable rather than re-creating on the client side
* Optionally hide 'revision' field in part tables
* Adds new "validated" field to the BomItem model
- Previously this was dynamically calculated (very expensive)
- Now cached and updated whenever a BomItem instance is saved
- Will make the BOM API much more responsive
- Cleanup BomItem list API code also
* Adds data migration to update existing BomItem objects
* Exclude 'validated' field from BomItemResource class
* Move render_currency into helpers.py
- Add duplicate tag to report.py
- Add option for currency conversion (optional)
* Update report templates
- Use "render_currency" instead of including price_data template
* Remove 'price_data.html' template entirely
* Unit test speed improvements
- Move from insantiating data in setUp to setUpTestData
* Update UserMixin class for API testing
* Bunch of test updates
* Further test updates
* Test fixes
* Add allowances for exchange rate server not responding
* Fixes for group role test
* Update PartSerializer queryset annotation
- Add 'total_stock' (in_stock + variant_stock)
- Update 'unallocated_stock' to use total_stock
* Allow API filtering by total_in_stock value
* Refactor partStockLabel method
- We'll use this in the partTable also
- Allow us to prevent further API calls
* Cleanup loadPartTable
* Refactor part variant table
* More updates to part badge function
* Bump API version
* js linting
* Pass "Part" instance to plugins when calling validate_serial_number
* Pass part instance through when validating IPN
* Improve custom part name validation
- Pass the Part instance through to the plugins
- Validation is performed at the model instance level
- Updates to sample plugin code
* Pass StockItem through when validating batch code
* Pass Part instance through when calling validate_serial_number
* Bug fix
* Update unit tests
* Unit test fixes
* Fixes for unit tests
* More unit test fixes
* More unit tests
* Furrther unit test fixes
* Simplify custom batch code validation
* Further improvements to unit tests
* Further unit test
* Adds unit test for counting queries on PurchaseOrderList API endpoint
- We will work to make this queryset more efficient
* PEP fixes
* Add 'total_price' fields to SalesOrder and PurchaseOrder models
* PurchaseOrder list API now has constant query count
* Data migration for updating existing PurchaseOrder and SalesOrder instances
- Calculate total_price for any existing order
- Will fail if exchange rates are not available
* Add total_price_currency to API serializers
* Render total_price in SalesOrder table
* Add ability to filter both lists by total_price field
* Update total_price whenever an order is updated
* Update total price whenever a lineitem is saved or deleted
* Add query-counting unit test for SalesOrder list API
* Calling refresh_from_db inside a save() method is *not* a good idea
* Add integration for django-slowtest
* Sample test improvement
- Reduces test from 0.7s to 0.2s
* Run CI tests with slowreport
* Fix requirements file
* Fix test command
* Fix bulk_create in unit tests
* Remove bulk_create entirely
* remove another bulk_create call
* Reduce long test from ~1000 seconds to ~1 second
* Change 'zh-cn' to 'zh-hans'
* Enforce consistent naming scheme when rendering translated javascript files
* More intelligent lookup of translated javascript files
- Ensure that the language code is lower-case (to match translated files)
- Provide fallback if specified langauge code is not found
* Replace underscore characters
* remove debug hook
* Add unit tests for validating number of queries
* Simplify category_detail annotation to PartList API endpoint
- Previous approach was an old hack from before the n+1 problem was understood
* Control when a new PartPricing object can be created
- Prevent this when calling from an on_delete signal
- There is an edge case where deleting a part triggers a series of on_delete signals inside an atomic transaction
- When the new PartPricing object is created,
* Add unit testing:
- Ensure PartPricing gets created when a new StockItem is added
- Part.delete() works without error
- PartPricing instances are deleted also
* style fixes
- Previously if the Part did not have a referenced PartPricing object, the schedule_pricing_update method would fail
- Required a PartPricing object to actually exist (i.e. be manually created)
- This patch fixes a logic error which resulted in updating being skipped if a PartPricing instance did not already exist
* Refactor forms for creating and editing SalesOrder
- Common function for defining fields
* More visual improvements for forms
* Refactor fields for SupplierPartPriceBreak
* More refactoring
* Refactor for stockitemtestresult table
* Comment fields
* JS linting fix
* Make 'copy_category_parameters' part of actual serializer
* Parameter copying is now handled by the API serializer
* Make field not required
* linting fixes
* pre commit fix
* Fix unit tests
* Further fix for unit test
* Unit tests for category parameter duplication
* Account for pack size when calculating purchase_price for received line items
* Clearer display of "unit pricing" when part has units
* Add data migration to fix historical pricing bugs
* Remove debug statement
* Update Meta class for StockLocation and PartCategory
* Migration files
* Add extra unique requirements to InvenTreeTree model
- unique_together does not work as expected with null values
* Add JS for qrcodejs
Ref: https://davidshimjs.github.io/qrcodejs/
* Simple function for rendering a QR code
* Refactor QR code view for Part
* Replace QR code view for SupplierPart
* Refactor QR codes for stock item and stock location models
* Remove base QRCodeView entirely
* Add settings to control upcoming stocktake features
* Adds migration for "cost range" when performing stocktake
* Add cost data to PartStocktakeSerializer
Implement a new custom serializer for currency data type
* Refactor existing currency serializers
* Update stocktake table and forms
* Prevent trailing zeroes in forms
* Calculate cost range when adding manual stocktake entry
* Display interactive chart for part stocktake history
* Ensure chart data are converted to common currency
* Adds new model for building stocktake reports
* Add admin integration for new model
* Adds API endpoint to expose list of stocktake reports available for download
- No ability to edit or delete via API
* Add setting to control automated deletion of old stocktake reports
* Updates for settings page
- Load part stocktake report table
- Refactor function to render a downloadable media file
- Fix bug with forcing files to be downloaded
- Split js code into separate templates
- Make use of onPanelLoad functionalitty
* Fix conflicting migration files
* Adds API endpoint for manual generation of stocktake report
* Offload task to generate new stocktake report
* Adds python function to perform stocktake on a single part instance
* Small bug fixes
* Various tweaks
- Prevent new stocktake models from triggering plugin events when created
- Construct a simple csv dataset
* Generate new report
* Updates for report generation
- Prefetch related data
- Add extra columns
- Keep track of stocktake instances (for saving to database later on)
* Updates:
- Add confirmation message
- Serializer validation checks
* Ensure that background worker is running before manually scheduling a new stocktake report
* Add extra fields to stocktake models
Also move code from part/models.py to part/tasks.py
* Add 'part_count' to PartStocktakeReport table
* Updates for stocktake generation
- remove old performStocktake javascript code
- Now handled by automated server-side calculation
- Generate report for a single part
* Add a new "role" for stocktake
- Allows fine-grained control on viewing / creating / deleting stocktake data
- More in-line with existing permission controls
- Remove STOCKTAKE_OWNER setting
* Add serializer field to limit stocktake report to particular locations
* Use location restriction when generating a stocktake report
* Add UI buttons to perform stocktake for a whole category tree
* Add button to perform stocktake report for a location tree
* Adds a background tasks to handle periodic generation of stocktake reports
- Reports are generated at fixed intervals
- Deletes old reports after certain number of days
* Implement notifications for new stocktake reports
- If manually requested by a user, notify that user
- Cleanup notification table
- Amend PartStocktakeModel for better notification rendering
* Hide buttons on location and category page if stocktake is not enabled
* Cleanup log messages during server start
* Extend functionality of RoleRequired permission mixin
- Allow 'role_required' attribute to be added to an API view
- Useful when using a serializer class that does not have a model defined
* Add boolean option to toggle whether a report will be generated
* Update generateStocktake function
* Improve location filtering
- Don't limit the actual stock items
- Instead, select only parts which exist within a given location tree
* Update API version
* String tweaks
* Fix permissions for PartStocktake API
* More unit testing for stocktake functionality
* QoL fix
* Fix for assigning inherited permissions
* Improve filtering options for StockItem list
- Make use of StockFilter introspection
* Remove outdated filter
* remove outdated "max_results" parameter
* Fix cascade issue for stocklist API
* Add relationship filters to the StockItemFilter
* Fix filtering by 'status' and 'allocated'
* Refactor 'customer' and 'expired' filters
* Cleanup
* Adds unit test for top-level stock location filtering
* Adds new model, API, serializers, etc
- Refactor InvenTreeAttachmentSerializer class
- Reduces code duplication
* Update front end
* Increment API version
* Add setting to control pricing calculation from stock items
* Bug fix for displaying a "null" setting
* Add new fields to PartPricing model
* Add code for calculation of min/max stock item costs
* Update pricing display to use stock item pricing
* Add unit testing for new pricing features
* Automatically update pricing when stock item is created or edited
* Increment API version
* Improvements for price rendering
* Update based on feedback:
- Roll stock item pricing into purchase pricing
- Simplify models
- Update unit tests
* Refactor javascript for creating a new part
* Simplify method of removing create fields from serializer
* Fix bug which resulted in multiple model instances being created
* remove custom code required on Part model
* Reorganize existing Part API test code
* Add child serializer for part duplication options
* Part duplication is now handled by the DRF serializer
- Improved validation options
- API is self-documenting (no more secret fields)
- More DRY
* Initial stock is now handled by the DRF serializer
* Adds child serializer for adding initial supplier data for a Part instance
* Create initial supplier and manufacturer parts as specified
* Adding unit tests
* Add unit tests for part duplication via API
* Bump API version
* Add javascript for automatically extracting info for nested fields
* Improvements for part creation form rendering
- Move to nested fields (using API metadata)
- Visual improvements
- Improve some field name / description values
* Properly format nested fields for sending to the server
* Handle error case for scrollIntoView
* Display errors for nested fields
* Fix bug for filling part category
* JS linting fixes
* Unit test fixes
* Fixes for unit tests
* Further fixes to unit tests
- If specified, the "remote_image" field is passed through to the __init__ method
- Throws a 500 error
- Solution is to explicitly ignore the provided field
* Move to updated Meta mixin
* [FR] Add last updated column for supplier parts
Fixes#3327
* add updated to table
* bump API version
* add missing migration
* incremetn api ;-)
* Added BOM export option to export substitute part numbers
* Small documentation fix
* Fixed the behaviour for multiple lines with different amount of substitutes
* Changed UI naming to "alternative parts"
* Reload purchase order table after part order
When on the part page, going to the "Purchase order" sidebar tab.
You can order the part by pressing the "Order Part" button.
After a succefull order, the form closes but the table on the page
was never refreshed.
* Fixed a js styling check error
* Move endpoints
[FR] Move download URL endpoints to API namespace
Fixes#3927
* rename endpoint ref name and update js
* update endpoint name and js
* rename endpoint and fix js
* add docstring