Commit Graph

13947 Commits

Author SHA1 Message Date
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
Matthias Mair
6133c745d7
[FR] Automated releases (#3316)
* [FR] Automated releases
automated messages on the socials
Fixes #3078

* Add more details to Reddit

* Fix twitter text

* fix syntax

* Update release.yml

Add hashtags to twitter post

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2022-07-10 22:23:10 +10:00
Matthias Mair
7493c8c6cb
Use metadata in projects for plugin info (#3282)
* Use metadata in projects for plugin info

* use metadata as backup
2022-07-09 17:06:50 +10:00
Matthias Mair
e314e879da
Fix broken copy (#3314)
* update clipboard version

* attach clipboard to about model

* make definition simpler

* make version text copyable
2022-07-09 12:49:53 +10:00
Matthias Mair
4b0b76ecc5
Make "confirm" buttons a user-configurable option. (#3313)
* Make "confirm" buttons a user-configurable option.
Add a new setting to enable the confirm button
Fixes #3069

* Add seperator
2022-07-09 10:28:52 +10:00
Oliver
849e54f2e9
New Crowdin updates (#3291)
* 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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-07-08 16:05:27 +10:00
Oliver
78264868e1
Allow negative currency values for "extra" line items (#3311) 2022-07-08 15:43:33 +10:00
Oliver
8f10bbb7e1
BOM Table Improvements (#3310)
* 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
2022-07-08 14:13:00 +10:00
Oliver
13dc14ce6f
Revert "Use python executable we were invoked with (#3303)" (#3309)
This reverts commit 0d9317addf.
2022-07-08 10:41:42 +10:00
Jakob Haufe
0d9317addf
Use python executable we were invoked with (#3303)
Relying on PATH will disrespect the virtualenv when called from
outside.
2022-07-07 09:02:07 +10:00
Oliver
cc8238b790
Allow BOM table to be filtered by "stock available" parameter (#3301)
* Allow BOM table to be filtered by "stock available" parameter

* Update API version info

* PEP fixes
2022-07-06 15:28:44 +10:00
Oliver
412fdf246a
Bump django version (#3299) 2022-07-06 10:10:09 +10:00
Oliver
0787264930
Allow searching of BOM List API endpoint (#3296)
* Allow searching of BOM List API endpoint

* Bump API version

* Adds ordering field options to BOM List API endpoint

* Add some unit testing for new API features

* Fixes for unit tests
2022-07-06 10:09:58 +10:00
Oliver
1235d47eca
Bug fix for sales order allocation table (#3295)
- Display serial number where available
2022-07-05 17:00:25 +10:00
Oliver
5045f85346
Optionally show/hide the "accept_overallocated" dialog option (#3290) 2022-07-04 12:51:51 +10:00
Oliver
fd03b4068d
Fix table sorting issues (#3289)
- 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
2022-07-04 12:06:56 +10:00
Oliver
7791631e87
New Crowdin updates (#3269)
* 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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-07-04 10:05:17 +10:00
Oliver
454760ed57
Fix spelling error (#3288)
immediatly -> immediately
2022-07-04 10:04:57 +10:00
Oliver
1ed49dcb2e
Use modern configuration for django-markdownify (#3286)
- Required to suppress some configuration warning messages
2022-07-04 07:45:36 +10:00
Oliver
830ecd5677
Update package requirements for docker (#3285)
* Include cargo / rustc in the docker image

- Otherwise cryptography library seems to fail

* Revert cryptography lib to older version

- New version requires rust, adds ~300MB to the image size!
2022-07-03 21:44:40 +10:00
Matthias Mair
c81043ba42
[FR] Add unit testing for emails (#3281)
Fixes #2232
2022-07-03 20:38:26 +10:00
Matthias Mair
9f5526f489
BREAKING (#3283)
Removes the depreciated class IntegrationPluginBase
2022-07-03 12:32:35 +10:00
Oliver
701b1e2145
Requirements fix (#3280)
* Constrain requirements-dev.in file based on requirements.txt

* Recompile requirements-dev.txt
2022-07-02 21:01:01 +10:00