InvenTree/InvenTree/templates
Oliver 648faf4ed2
Reference fields (#3267)
* 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
2022-07-11 00:01:46 +10:00
..
InvenTree Reference fields (#3267) 2022-07-11 00:01:46 +10:00
account Remove custom javascript from auth pages (#3250) 2022-06-25 07:45:50 +10:00
allauth_2fa Small visual tweaks to various auth views (#3238) 2022-06-23 07:09:17 +10:00
email Adds notification when items are received against a purcahse order (#3259) 2022-06-27 07:30:38 +10:00
js Reference fields (#3267) 2022-07-11 00:01:46 +10:00
patterns/wizard fix endline 2022-05-20 13:35:07 +02:00
plugin fix endline 2022-05-20 13:35:07 +02:00
registration "normal" admin-logout message 2021-09-03 00:23:29 +02:00
sample fix endline 2022-05-20 13:35:07 +02:00
socialaccount/snippets fix trailing 2022-05-20 13:20:55 +02:00
403.html fix endline 2022-05-20 13:35:07 +02:00
403_csrf.html Adds a template for handling 403 errors due to CSRF issues (#3260) 2022-06-26 18:09:58 +10:00
404.html fix endline 2022-05-20 13:35:07 +02:00
500.html fix endline 2022-05-20 13:35:07 +02:00
503.html fix trailing 2022-05-20 13:20:55 +02:00
about.html Fix broken copy (#3314) 2022-07-09 12:49:53 +10:00
admin_button.html fix endline 2022-05-20 13:35:07 +02:00
attachment_button.html fix endline 2022-05-20 13:35:07 +02:00
attachment_table.html Fix API endpoint permission for the "AttachmentMixin" class (#3218) 2022-06-18 14:48:09 +10:00
base.html Remove custom javascript from auth pages (#3250) 2022-06-25 07:45:50 +10:00
clip.html fix endline 2022-05-20 13:35:07 +02:00
collapse_rows.html Sales order tables (#3225) 2022-06-18 22:22:00 +10:00
expand_rows.html Sales order tables (#3225) 2022-06-18 22:22:00 +10:00
filter_list.html fix endline 2022-05-20 13:35:07 +02:00
hover_image.html fix endline 2022-05-20 13:35:07 +02:00
image_download.html fix endline 2022-05-20 13:35:07 +02:00
mail.html fix endline 2022-05-20 13:35:07 +02:00
modal_csrf.html fix endline 2022-05-20 13:35:07 +02:00
modal_delete_form.html Add a generic DeleteForm and update AjaxDeleteView 2019-05-13 22:46:47 +10:00
modal_form.html same treatment for html 2021-05-06 14:33:03 +02:00
modals.html fix endline 2022-05-20 13:35:07 +02:00
navbar.html fix trailing 2022-05-20 13:20:55 +02:00
notes_buttons.html fix endline 2022-05-20 13:35:07 +02:00
notifications.html fix endline 2022-05-20 13:35:07 +02:00
page_base.html Part page loading improvements (#3185) 2022-06-17 21:26:28 +10:00
panel.html fix endline 2022-05-20 13:35:07 +02:00
price.html fix endline 2022-05-20 13:35:07 +02:00
qr_button.html fix endline 2022-05-20 13:35:07 +02:00
qr_code.html fix endline 2022-05-20 13:35:07 +02:00
search.html fix trailing 2022-05-20 13:20:55 +02:00
search_form.html Search button fix 2021-11-15 23:06:15 +11:00
sidebar_header.html fix endline 2022-05-20 13:35:07 +02:00
sidebar_item.html fix tags 2022-01-21 02:11:34 +01:00
sidebar_link.html fix tags 2022-01-21 02:11:34 +01:00
sidebar_toggle.html fix tags 2022-01-21 02:11:34 +01:00
skeleton.html Remove custom javascript from auth pages (#3250) 2022-06-25 07:45:50 +10:00
spacer.html fix endline 2022-05-20 13:35:07 +02:00
stats.html fix docs link for "email settings not configured" warning (#3209) 2022-06-17 08:14:40 +10:00
status_codes.html fix trailing 2022-05-20 13:20:55 +02:00
stock_table.html Refactorin' 2022-03-03 21:16:27 +11:00
tel.html fix endline 2022-05-20 13:35:07 +02:00
third_party_js.html Part page loading improvements (#3185) 2022-06-17 21:26:28 +10:00
url.html fix endline 2022-05-20 13:35:07 +02:00
version.html fix endline 2022-05-20 13:35:07 +02:00
yesnolabel.html fix endline 2022-05-20 13:35:07 +02:00