Commit Graph

13619 Commits

Author SHA1 Message Date
Matthias Mair
9ccf211650
fix gtipod.io (#3415) 2022-07-29 18:42:38 +10:00
Oliver
5b650a5c55
New Crowdin updates (#3427)
* updated translation base

* 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>
2022-07-29 15:02:06 +10:00
Matthias Mair
e461a2c1ef
Development improvements (#3413)
* rename .env to make sure it is not loaded by default

* make sure migrations are run before import

* Add more messaget to setup_test

* add comments to setup-dev

* Add flag to setup-dev for setting up test data

* add flag to setup-test to also run development setup

* extend contributing with the flags

* change flag to tests

* Add option helptexts

* A nicer starter

* add 3 liner

* Revert "rename .env to make sure it is not loaded by default"

This reverts commit 95fa0bbc53.
2022-07-29 14:58:54 +10:00
Oliver
4d5e267753
Fit for unit test (#3426)
* Fit for unit test

- Write known value to setting before perfoming read test

(cherry picked from commit 7042d8b9badb7bf50f6f6566c3d4171d68d43f0c)

* Allow longer timeout for image download tests

(cherry picked from commit e1ce13043f)
2022-07-28 13:52:16 +10:00
miggland
2b1658e513
Fix version-copy button according to #3373 (#3425) 2022-07-28 08:06:32 +10:00
Oliver
8f9981a3b6
Convert PosixPath to string for plugin loading (#3423) 2022-07-27 21:59:23 +10:00
Oliver
9110035370
Fix "part" column sorting in BOM table (#3422) 2022-07-27 19:58:48 +10:00
Oliver
3d67cabb1a
New Crowdin updates (#3405)
* updated translation base

* 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 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>
2022-07-27 19:14:06 +10:00
Oliver
851683a456
Fixes bug introduced by moving to pathlib (#3419)
* Fix typo

* Fix bug which prevented rendering of settings page if neither user-agent or user-device was available

* Add unit testing for settings page
2022-07-27 17:44:14 +10:00
Oliver
ab654c3ae7
Disable redis image by default (#3416)
- Enable using the docker --profile command
2022-07-27 13:02:26 +10:00
Oliver
74fbd30982
Allow SupplierPart list to be filtered by SKU (#3417)
* Allow SupplierPart list to be filtered by SKU

* Bump API version

* Allow SupplierPart list to be filtered by MPN (manufacturer part number)

* Simplify filter definition

* Code formatting

* Update API docs
2022-07-27 13:02:13 +10:00
Matthias Mair
794e375009
Switch to pathlib (#3392)
* switch to pathlib

* more pathlib

* useconvert env to path

* fix typo

* use resolve instead of absolute

* fix gitppod

* also allow parents

* replace more os operations

* fix string replacement feature

* make sure root dirs exsist

* fix replace function

* refactor duplicate code

* reduce code

* make sure dirs exist

* fix typo

* also create parent dirs

* fix match statement

* fix statments expecting string

* return getMigrationFileNames to old behaviour

* fully resolve config file

* make sure comparison works

* use pathlib in tasks

* fix file count test

* reduce code duplication in test + add test for part

* fix test

* re-add os

* Make pathlib usage simpler
2022-07-27 10:42:34 +10:00
Matthias Mair
551f66ff90
[BUG] Extra url schemes not working. (#3414)
* [BUG] Extra url schemes not working.
Fixes #3411

* style fixes

* style fixes

* add docstring
2022-07-27 10:23:09 +10:00
Oliver
7cabb78964
Docker compose relative path (#3410)
* Update development docker-compose file

- Remove external volume definition
- v2 does not allow relative path spec here
- Simplification is only required for dev version

* Remove old debug messages

* Update docker build CI step

- Check that required directories / files have been created in the correct location(s)

* Add check for pgdb directory

* Run partial docker check on pull_request

* Disable workflow running on pull requests
2022-07-27 07:50:54 +10:00
Oliver
622c0636ef
Remove references to "plugins" volume in production docker-compose file (#3406) 2022-07-26 15:29:37 +10:00
Oliver
b98ae25583
Allow plugin loading from external directory (#3364)
* Load custom plugin directories

* Allow plugins to be loaded from an external directory

* Handle exception when path is not relative to base path

* Fix typo

* Use pathlib

* Move plugin directory code into registry.py

- Allows us to reload plugins without having to reload the server itself

Co-authored-by: Matthias Mair <code@mjmair.com>
2022-07-26 14:35:01 +10:00
Oliver
805accb479
Too generous with a's (#3404) 2022-07-26 12:18:07 +10:00
Matthias Mair
6c71a26613
make sure pip is upgraded (#3401)
At the beginning of installs
2022-07-26 11:21:25 +10:00
miggland
58bff32342
Correct the docstring for PurchaseOrderIssue (#3399) 2022-07-26 07:28:11 +10:00
Oliver
c42c0e1e48
New Crowdin updates (#3315)
* updated translation base

* 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 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 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 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 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 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>
2022-07-25 14:27:14 +10:00
Oliver
05d7159882
Pre-fill quantity on part ordering form (#3395)
* Pre-fill quantity on part ordering form

- Adds new API endpoint for requirement data
- Load data on the fly when launching ordering form

* Bump API version
2022-07-25 13:00:35 +10:00
luwol03
61ac02a045
Fix LabelPrintingMixin label_instance contains now specific data (#3394) 2022-07-25 11:23:20 +10:00
Oliver
eecb26676e
Refctor image downloader (#3393)
* Adds configurable setting for maximum remote image size

* Add helper function for downloading image from remote URL

- Will replace existing function
- Performs more thorough sanity checking

* Replace existing image downloading code

- part image uses new generic function
- company image uses new generic function

* Rearrange settings

* Refactor and cleanup existing views / forms

* Add unit testing for image downloader function

* Refactor image downloader forms

- Part image download now uses the API
- Company image download now uses the API
- Remove outdated forms / views / templates

* Increment API version

* Prevent remote image download via API if the setting is not enabled

* Do not attempt to validate or extract image from blank URL

* Fix custom save() serializer methods
2022-07-25 11:17:59 +10:00
Oliver
d32054b53b
Remove code left over from previous commit (#3385)
* Remove code left over from previous commit

* Handle invalid image loaded with uploaded_image report template tag

* Add option to *not* use a custom logo

* Fix unit tests
2022-07-22 17:33:28 +10:00
Oliver
779646771d
Use different twitter action (#3387) 2022-07-22 13:44:40 +10:00
Oliver
d2ab6b012d
Refactor template helpers for displaying uploaded images (#3377)
* Refactor template helpers for displaying uploaded images

* Unit test for asset tag

* Unit tests for 'uploaded_image' tag

* Add simple tests for part_image and company_image functions

* Unit test for barcode constructor

* Unit tests for qrcode

* Refactor the 'company_logo.png' to be a new template tag

- Add unit tests

* Adds a new field to the report asset model

- Unique key which can be used to identify particular assets
- e.g. company logo

* Refactor logo image tags

- Make use of existing CUSTOM_LOGO setting
- Adds a "logo_image" template tag for reports

* Remove previous migration - strategy no longer required
2022-07-22 12:01:56 +10:00
miggland
2bc8556993
Fix issue 3371 (#3381)
* Add missing underscore for translation

* Fix issue #3371

* Modify comment
2022-07-21 22:09:52 +10:00
Matthias Mair
864d69d968
Add test command (#3372)
* integrate test loading as task - use with gitpod

* ignore test data with git
2022-07-21 11:41:42 +10:00
Matthias Mair
09987ad79b
Remove special characters restriction in category names (#3370)
* [FR]Special characters restriction in category names
Fixes #3358

* remove old validation test
2022-07-21 11:33:21 +10:00
Oliver
aca58dedc0
Fix for docker signing (#3363)
- Add required "images" attribute
- Ref: https://github.com/docker/metadata-action#images-input
2022-07-20 18:32:18 +10:00
Matthias Mair
dbbdaf39c7
[FR] Sign artifacts with sigstore (#3347)
Fixes #3077
2022-07-20 16:20:58 +10:00
Oliver
afcd60b387
Create SupplierPart directly from PurchaseOrderLineItem dialog (#3361)
* Move JS code from html to external .js file

* Add secondary dialog for creating a new SupplierPart from the PurchaseOrderLineItem dialog

* JS linting
2022-07-20 12:53:31 +10:00
Oliver
e383d6e955
Update unit tests to match new docker paths (#3360)
* Update unit tests to match new docker paths

Ref: https://github.com/inventree/InvenTree/pull/3357

* Add "wait" step before running dev server
2022-07-20 11:44:25 +10:00
Oliver
5bb76a3730
Docker compose plugins fix (#3357)
* Simplify dockerfile - remove INVENTREE_DEV_DIR

- We can simply use INVENTREE_DATA_DIR
- Will need to update the documentation

* Remove plugin dir support from production docker-compose file
2022-07-20 09:05:05 +10:00
Oliver
f0d69ec458
Fix API filtering for PurchaseOrderLineItem (#3356) 2022-07-19 10:09:22 +10:00
Matthias Mair
cbae4474ab
Allow installation of local plugins via docker (#3348)
* Add option to mpunt plugins to docker

* [FR] Allow installation of local plugins via docker
Fixes #3343
2022-07-19 08:18:54 +10:00
Oliver
f23cef0400
docker: prevent ports being exposed outside container context (#3351) 2022-07-18 14:08:33 +10:00
Matthias Mair
7549d033df
Use env-variable for image tag (#3350) 2022-07-18 09:09:04 +10:00
Matthias Mair
6aeb818137
Fix pre-commit complaints (#3349)
* fixes a B023 error by refactoring the function call

* restructure for correct lambda
2022-07-18 08:57:14 +10:00
Matthias Mair
d5014ab6ac
Fix POST testing (#3346)
* make call simpler

* switch back to reqres.in for POST
2022-07-18 08:35:23 +10:00
nwns
ce0af287f2
chore: don't confuse type checker by fetching after the if (#3344) 2022-07-18 08:15:52 +10:00
Oliver
6e2a2f2b2c
Bug fix for recent SupplierPart API annotation (#3336) 2022-07-15 20:30:26 +10:00
Oliver
653dcd4526
Annotate "in_stock" quantity to SupplierPart API (#3335)
* Annotate "in_stock" quantity to SupplierPart API

* Increment API version
2022-07-15 17:37:02 +10:00
Oliver
739489840b
Support CNY by default (#3334)
- Adds default support for CNY currency
2022-07-15 15:16:35 +10:00
Oliver
2afd39356a
Int migration fix (#3323)
* Add fix for stock migration

- Ensure the serial number is not too large when performing migration
- Add unit test for data migration

(cherry picked from commit 661fbf0e3d)

* Add similar fixes for PO and SO migrations

(cherry picked from commit bde23c130c)

* And similar fix for BuildOrder reference field

(cherry picked from commit ca0f4e0031)

* Update unit tests for API plugin mixin class

- API at previous target URL has changed
- Simplier to use the github API as a test case

(cherry picked from commit dfe3172b7d)

* Revert test database name

(cherry picked from commit 53333c29c3)

* Override default URL behaviour for unit test

(cherry picked from commit 2c12a69529)
2022-07-15 11:57:27 +10:00
Oliver
2635327c51
Add 'refresh' button for part parameter table (#3329)
* Add 'refresh' button for part parameter table

* Override default URL behaviour for unit test

(cherry picked from commit 2c12a69529)
2022-07-15 11:55:39 +10:00
Oliver
0e157950dc
Update unit tests for API plugin mixin class (#3328)
* Update unit tests for API plugin mixin class

- API at previous target URL has changed
- Simplier to use the github API as a test case

* Revert test database name

* Override default URL behaviour for unit test
2022-07-15 08:19:49 +10:00
Oliver
67732f8f81
Remove custom 2FA code (#3300)
* Update django-allauth-2fa to latest version

* Remove custom view / form for removing token

* Revert "2FA disable" view to custom view

- Allows specification of custom redirect URL
2022-07-11 10:26:41 +10:00
Oliver
7376e34505
Prevent creation of new settings objects when importing data (#3319) 2022-07-11 09:40:44 +10:00
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