* Adds a configurable 'reference pattern' to the IndexingReferenceMixin class
* Expand tests for reference_pattern validator:
- Prevent inclusion of illegal characters
- Prevent multiple groups of hash (#) characters
- Add unit tests
* Validator now checks for valid strftime formatter
* Adds build order reference pattern
* Adds function for creating a valid regex from the supplied pattern
- More unit tests
- Use it to validate BuildOrder reference field
* Refactoring the whole thing again - try using python string.format
* remove datetime-matcher from requirements.txt
* Add some more formatting helper functions
- Construct a regular expression from a format string
- Extract named values from a string, based on a format string
* Fix validator for build order reference field
* Adding unit tests for the new format string functionality
* Adds validation for reference fields
* Require the 'ref' format key as part of a valid reference pattern
* Extend format extraction to allow specification of integer groups
* Remove unused import
* Fix requirements
* Add method for generating the 'next' reference field for a model
* Fix function for generating next BuildOrder reference value
- A function is required as class methods cannot be used
- Simply wraps the existing class method
* Remove BUILDORDER_REFERENCE_REGEX setting
* Add unit test for build order reference field validation
* Adds unit testing for extracting integer values from a reference field
* Fix bugs from previous commit
* Add unit test for generation of default build order reference
* Add data migration for BuildOrder model
- Update reference field with old prefix
- Construct new pattern based on old prefix
* Adds unit test for data migration
- Check that the BuildOrder reference field is updated as expected
* Remove 'BUILDORDER_REFERENCE_PREFIX' setting
* Adds new setting for SalesOrder reference pattern
* Update method by which next reference value is generated
* Improved error handling in api_tester code
* Improve automated generation of order reference fields
- Handle potential errors
- Return previous reference if something goes wrong
* SalesOrder reference has now been updated also
- New reference pattern setting
- Updated default and validator for reference field
- Updated serializer and API
- Added unit tests
* Migrate the "PurchaseOrder" reference field to the new system
* Data migration for SalesOrder and PurchaseOrder reference fields
* Remove PURCHASEORDER_REFERENCE_PREFIX
* Remove references to SALESORDER_REFERENCE_PREFIX
* Re-add maximum value validation
* Bug fixes
* Improve algorithm for generating new reference
- Handle case where most recent reference does not conform to the reference pattern
* Fixes for 'order' unit tests
* Unit test fixes for order app
* More unit test fixes
* More unit test fixing
* Revert behaviour for "extract_int" clipping function
* Unit test value fix
* Prevent build order notification if we are importing records
* Bug fix for "multi delete" form
- Was requesting entire LIST endpoint before launching form
- Could cause extremely long delays before window opened
* Improve rendering of "no stock available" in BOM table
* Adds footer row to BOM table
- Display total number of parts
- Display minimum "can build" amount
* Added extra information to footer row
* Annotate 'ordering' quantity to BOM list
- Display this quantity in the BOM table
* Bump API version
* JS linting
* Allow BOM list to be filtered by "on_order" parameter
* Add information showing amount that can be built once orders are received
- Recent update changed default table pagination to "server"
- This broke at least the BOM table, maybe others
- Revert the behaviour to previous to observe old defaults
- Update pagination mode for attachment tables specifically
* Add 'virtual': False requirement to sales order items
* Adds "virtual" filter for part table
* Adds extra validation to the SalesOrderLineItem model
* Prevent creation of stock items for virtual parts
- Add validation check to clean() method of StockItem model
- Improve validation message for StockItemSerializer class
* Hide "new stock item" button for virtual parts
* Hide more buttons for 'virtual' parts
* Bug fix for field validation on child forms
- If a child form is launched which conatins numerical inputs, field validation fails
- Not taking the "level" parameter into account when looking for the field
* trim long description strings in modal forms
* Remove custom javascript from auth pages
- Unauthorized user cannot load these scripts
- Simply throws console errors
* Split basic "show message" function out into new js file
* Split more generic functions out into new .js file
* javascript linting fix
* Fix API endpoint permission for the "AttachmentMixin" class
- Any authenticated user could perform CREATE and UPDATE operations on attachments
- Could be performed via the browsable DRF API
- Could also be performed via the front-end (with some advaned jiggering of OPTIONS code)
* Show or hide buttons depending on the permissions of the user
* Add shortcut for table permission check
* Lazy load the pricing bom table when the "pricing" tab is selected
* Update django-debug-toolbar configuration
* Major refactoring for the 'can_build' function
- Use a single annotated query to the db, rather than a for loop (which is what a caveman would use)
- Query performance is greatly improved
- Also refactors existing variant-part-stock subquery code, to make it re-usable
* Use minified JS and CSS where possible
* Render a 'preview' version of each part image
- Saves load time when the image is quite large
- Adds a data migration to render out the new variation
* Adds 'preview' version of company images
* Defer loading of javascript files
Note: some cannot be deferred - jquery in particular
* Crucial bugfix for user roles context
- Previously was *not* being calculated correctly
- A non-superuser role would most likely display pages incorrectly
* Prevent loading of "about" on every page
- Load dynamically when requested
- Takes ~400ms!
- Cuts out a lot of fat
* Match displayed image size to preview image size
* Utilize caching framework for accessing user "role" information
- Reduces number of DB queries required by rendering framework
* Remove redundant query elements
* Remove 'stock' field from PartBrief serializer
- A calculated field on a serializer is a *bad idea* when that calculation requires a DB hit
* Query improvements for StockItem serializer
- Remove calculated fields
- Fix annotations
* Bug fixes
* Remove JS load test
- Loading of JS files is now deferred, so the unit test does not work as it used to
* Fix broken template for "maintenance" page
* Remove thumbnail generation migrations
- Already performed manually as part of ''invoke migrate"
- Running as a migration causes unit test problems
- Not sensible to run this as a data-migration anyway
* tweak for build table
* Improvement and consolidation of various auth forms
* Update "disable 2FA" page to use form fields
Note: Requires merging of https://github.com/valohai/django-allauth-2fa/pull/135
* Update django-allauth-2fa requirements
* Updates for label printing settings:
- Make LABEL_ENABLE a global setting
- Add LABEL_DPI setting (default = 300)
- Add new global settings tab
* Use the configured DPI when printing labels
* Enable HTML escaping for all tables by default
* Enable HTML escaping for all tables by default
* Adds automatic escaping for bootstrap tables where custom formatter function is specified
- Intercept the row data *before* it is provided to the renderer function
- Adds a function for sanitizing nested data structure
* Sanitize form data before processing
* Delete category via the API
* Delete StockLocation via the API
* Delete StockItem via the API
- Removes the final instance of AjaxDelete
* Remove URL path
* Add missing code
* Adds new fields to the SupplierPart model:
- available
- availability_updated
* Allow availability_updated field to be blank
* Revert "Remove stat context variables"
This reverts commit 0989c308d0.
* Increment API version
* Adds availability information to the SupplierPart API serializer
- If the 'available' field is updated, the current date is added to the availability_updated field
* Add 'available' field to SupplierPart table
* More JS refactoring
* Add unit testing for specifying availability via the API
* Display availability data on the SupplierPart detail page
* Add ability to set 'available' quantity from the SupplierPart detail page
* Revert "Revert "Remove stat context variables""
This reverts commit 3f98037f79.
* Catch DoesNotExist error
* Move notificationtable function to js file
* Fix for custom metadata class
- Previously only worked if a POST or PUT action was available on the endpoint
- So, a ListAPIView endpoint would not actually work!
- Adding in a BulkDelete mixin to a ListAPIView caused failure
* Add unit test to ensure new OPTIONS metadata updates are checked
* Expand functionality of the existing BulkDelete mixin
- Allow deletion by custom filters
- Allow each implementing class to implement custom filters
- Adds more unit testing for BulkDelete mixin class
* Add bulk delete operation for Notification API
- Ensure users can only delete their *own* notifications
* Improve notification tables / buttons / etc
* Adds unit testing for bulk delete of notifications
- Fixed API permissions for notifications list endpoint
* Update BulkDelete operations for the StockItemTestResult table
* Use filters parameter in attachments table to ensure that only correct attachments are deleted
* JS linting
* Fixes for unit tests
* Trigger a notification when a new SalesOrder is created
- Notify the "responsible" owners (excluding the creator)
- Add unit test for new notification
* Adds notification when a new PurchaseOrder is created
* Add notification when a new build order is created
- Includes unit tests
* Refactor order notification code
- Adds a "exclude users" option for sending notifications
* Fixes for notification refactoring
* make notification a helper
* reduce statements togehter
* make reuse easier
* Add docs
* Make context variables clearer
* fix assertation
* Fix set notation
Co-authored-by: Matthias <code@mjmair.com>
* Introduces a BulkDelete API mixin class
- Allows deletion of multiple items against a single API request
* Bump API version
* Adds BulkDelete mixin to StockItemTestResult API class
* refactor "multi BOM Item delete" to use new approach
* Refactor various attachment API endpoints
* Refactor multi delete for StockItem
* Convert remaining enndpoints over
* Fix for API test code
* Adds a background task to notify users when a PurchaseOrder becomes overdue
* Schedule the overdue purchaseorder check to occur daily
* Allow notifications to be sent to "Owner" instances
- Extract user information from the Owner instance
* add unit test to ensure notifications are sent for overdue purchase orders
* Adds notification for overdue sales orders
* Clean up notification display panel
- Simplify rendering
- Order "newest at top"
- Element alignment tweaks
* style fixes
* More style fixes
* Tweak notification padding
* Fix import order
* Adds task to notify user of overdue build orders
* Adds unit tests for build order notifications
* Refactor subject line for emails:
- Use the configured instance title as a prefix for the subject line
* Add email template for overdue build orders
* Fix unit tests to accommodate new default value
* Logic error fix
* Add new global setting to control auto-upload of test reports
* Adds callback to attach a copy of the test report when printing
* Fix for all attachment API endpoints
- The AttachmentMixin must come first!
- User was not being set, as the custom 'perform_create' function was never called
* Remove duplicated UserSerializer
* display uploading user in attachment table
* Add unit test to check the test report is automatically uploaded
* Refactor function to enable / disable submit button on modal forms
* Category selection now just uses the AP
* Remove unused forms / views
* JS linting fixes
* remove outdated unit test
* Updates for the PartRelated model
- Deleting a part also deletes the relationships
- Add unique_together requirement
- Bug fixes
- Added unit tests
* Adds JS function to delete a part instance
* Remove legacy delete view
* JS linting
* Moving PartCategoryParameterTemplate model to the API
- Add detail API endpoint
- Add 'create' action to LIST endpoint
* Update settings page to use the new API forms
* Remove old views / forms
* Update API version
* Fix table buttons
* Add title to deletion form
* Add unit tests for new API views
* Adds detail API view for the PartParameterTemplate model
* Use API methods rather than server-side forms
* Remove old views / forms
* Update API version
* Refactor out 'ordering' serializer annotation field
* Refactor BomItem serializer annotations
* Factor out MPTT OuterRef query
* Add 'available_stock' annotation to SalesOrderLineItem serializer
- Allows for better rendering of stock availability in sales order table
* Improve 'available quantity' rendering of salesorderlineitem table
* Bump API version
* Add docstring
* Allow part list API to be searched by SKU
* Enable manufacturer parts and supplier parts search preview
* Increment API version
* Remove whitespace
* Remove more whitespace
* Add pre-commit to the stack
* exclude static
* Add locales to excludes
* fix style errors
* rename pipeline steps
* also wait on precommit
* make template matching simpler
* Use the same code for python setup everywhere
* use step and cache for python setup
* move regular settings up into general envs
* just use full update
* Use invoke instead of static references
* make setup actions more similar
* use python3
* refactor names to be similar
* fix runner version
* fix references
* remove incidential change
* use matrix for os
* Github can't do this right now
* ignore docstyle errors
* Add seperate docstring test
* update flake call
* do not fail on docstring
* refactor setup into workflow
* update reference
* switch to action
* resturcture
* add bash statements
* remove os from cache
* update input checks
* make code cleaner
* fix boolean
* no relative paths
* install wheel by python
* switch to install
* revert back to simple wheel
* refactor import export tests
* move setup keys back to not disturbe tests
* remove docstyle till that is fixed
* update references
* continue on error
* use relativ action references
* Change step / job docstrings
* Enable 'tree view' for build order table
* Ensure we pass locale code to the build table
* Adjust button class based on current context
* Fix display of 'child builds' table on build page
* Force a rebuild of the entire table when the filters are refreshed
* Refactor PurchaseOrder table also
* Refactor existing SalesOrder table also
* JS linting
* Refactor 'DeleteManufacturerPart' form
- Remove duplicated forms
- Update style to match other forms
- Block on each deletion before progressing to the next one
* PEP fix
* Adds deleteSupplierParts function
* Refactor all instances of supplier part deletion
* Refactor tractor : use convenience function for bootstraptable.getSelections
* Add deleter for manufacturerpartparameter.
Refactor existing code into a single function
* Refactor deletion for stock items
* JS linting
* Adds two new fields to SalesOrderShipment model:
- Invoice number (char)
- Link (URL)
* Bump API version
* Update API / serializer / JS
- Allow entry of new fields at time of shipping
* PEP fixes
* Actually fix the PEP issues
* Unit testing: check some more fields