2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-14 19:15:41 +00:00
Commit Graph

14469 Commits

Author SHA1 Message Date
7a8e59305f Allow label printing when custom plugins not enabled (#5266)
- Will still allow "builtin" plugins to function
2023-07-18 10:34:50 +10:00
5862c70b24 Update python.md (#5264)
Just a typo corrected in a script sample.
2023-07-18 09:04:58 +10:00
e8d16298a4 Label plugin refactor (#5251)
* Add skeleton for builtin label printing plugin

* Force selection of plugin when printing labels

* Enhance LabelPrintingMixin class

- Add render_to_pdf method
- Add render_to_html method

* Enhance plugin mixin

- Add class attribute to select blocking or non-blocking printing
- Add render_to_png method
- Add default method for printing multiple labels
- Add method for offloding print job

* Simplify print_label background function

- All arguments now handled by specific plugin

* Simplify label printing API

- Simply pass data to the particular plugin
- Check result type
- Return result

* Updated sample plugin

* Working on client side code

* Cleanup

* Update sample plugin

* Add new model type

- LabelOutput model
- Stores generated label file to the database
- Makes available for download

* Update label printing plugin mixin

* Add background task to remove any old label outputs

* Open file if response contains filename

* Remove "default printer" option which does not specify a plugin

* Delete old labels after 5 days

* Remove debug statements

* Update API version

* Changed default behaviour to background printing

* Update label plugin mixin docs

* Provide default printer if none provided (legacy)

* Update unit test

* unit test updates

* Further fixes for unit tests

* unit test updates
2023-07-17 21:39:53 +10:00
4d7fb751eb remove unneeded gunicorn (#5248) 2023-07-17 20:53:02 +10:00
8daff0bff4 Support traditional Chinese (zh-hant) locale (#5261) 2023-07-17 20:45:13 +10:00
df77305d60 Fix settings function callback (#5259)
* fix settings function callback

* merge instance filters and passed keys
2023-07-17 20:19:32 +10:00
20b59c3575 Fix language code for pt-br (#5256)
- Has to be lowercase in settings.py to work correctly
2023-07-16 19:35:03 +10:00
370021bc7c Update docs to match reality (#5255) 2023-07-15 23:55:22 +10:00
2e35b861ef New Crowdin updates (#5221)
* 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

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-15 08:39:13 +10:00
034cc4b983 Translation stat fix (#5250)
* Add helper function for translation coverage

- Handle case where locale name does not match exactly

* remove debug statement

* Fixes
2023-07-15 08:38:39 +10:00
4a46e0321f fix: make protected setting again changeable through admin ui (#5245) 2023-07-14 08:57:19 +10:00
f4f39e274f Add https comment to nginx file (#5243) 2023-07-14 08:53:37 +10:00
0aee2a11c4 Fix weasyprint links (#5244)
* Fix weasyprint links

* Update report.md
2023-07-13 18:31:05 +02:00
41167f22c9 Only update theme if value provided (#5240)
- Handles case where null or invalid value provided
2023-07-13 20:34:41 +10:00
bd1689095d fix typo (#5236) 2023-07-13 10:30:19 +10:00
01f2aa5f74 Protected settings fix (#5229)
* Hide protected setting in settings view

* Implement custom serializer for setting value

- Return '***' if the setting is protected

* Implement to_internal_value

* Stringify

* Add protected setting to sample plugin

* Unit tests for plugin settings API

* Update unit test
2023-07-12 16:29:08 +10:00
ee274739a6 Added required attribute to settings/plugins, refactor: allValues (#5224)
* Added required attribute to settings/plugins, refactor: allValues

- added 'required' attribute to InvenTreeBaseSetting
- added 'check_all_settings'
- added 'all_settings' to get a list of all defined settings
- refactored 'allValues' to use new 'all_settings' function
- added docs for new 'check_setting' function on plugin SettingsMixin

* Fix typing to be compatible with python 3.9

* trigger: ci

* Fixed **kwargs bug and added tests
2023-07-12 08:19:19 +10:00
b3dcc28bd9 Add missing callback for attachment delete button (#5219) 2023-07-11 10:29:33 +10:00
a9a8ac1c70 Add email login (#5209)
* Add email login
FR] Add email link based logins Closes #3531

* fix reqs

* fix backend code

* Add tests for magic login
2023-07-11 08:13:35 +10:00
92b0a19270 Docker: add missing reporting libs (#5213)
* Docker: add missing reporting libs

* Fix pango / cairo libs

Ref: https://github.com/Kozea/WeasyPrint/issues/699

* Move to where it will actually do something

* Remove continuation

* Remove dev packages
2023-07-10 21:12:17 +10:00
4a1f73331f Refactor: Dockerimage (#5007)
* refactor docker image to reduce size

* Added required deps for database drivers

* Added alpine test dockerfile

* Readded image libs to Dockerfile

* Fix link in dockerfile

* Replaced Dockerfile

* Remove bash from image

* Added base target to Dockerfile

* Added missing mysql dev headers

* Add dev target back to Dockerfile

* fix: Dockerfile style

* Add old comments back to dockerfile

* Removed wrong comment

* Added back piwheels repo
2023-07-10 19:52:33 +10:00
8fb7612894 Fix link to SalesOrder in stock history table (#5210) 2023-07-10 13:13:35 +10:00
ae046c778e support debian 12 (#5205) 2023-07-09 08:40:53 +10:00
d4fad4f5c8 fix cli on 22.04 (#5204) 2023-07-09 08:40:27 +10:00
b37b8a8610 fix: generic status import (#5192) 2023-07-09 08:39:26 +10:00
1f81daadf6 Fix allocation check for completing build order (#5199)
- Allocation check only applies to untracked line items
2023-07-07 13:27:35 +10:00
24ae21b342 Fix 404 link in docker_prod.md (#5193) 2023-07-07 08:12:50 +10:00
4b40fe5ea1 New Crowdin updates (#5172)
* 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

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-06 13:09:49 +10:00
e9a0b02d3d Fix range filtering for serial number (#5189)
* Fix range filtering for serial number

- Needs to point to "serial_int" field to work

* Bump API version

(cherry picked from commit c3cb47ec15bbba1bf5d6d46374ac29b627f5bf34)
2023-07-06 13:08:08 +10:00
773dd3b210 Fix quantity aggregation for stock table (#5188)
* Fix quantity aggregation for stock table

- Stock quantity can only be added together if units are the same

* Add stock total footer to part table
2023-07-06 12:54:05 +10:00
2d2a084866 Shorten string fix (#5187)
* Fix for model renderer code

- Handles string shortening without corrupting HTML

* Fix for BOM table
2023-07-06 12:37:40 +10:00
35defe78c0 Stocktake location filter (#5185)
* Pass specified location to "perform_stocktake"

* Separately track total stocktake and location stocktake data

* Catch any exception
2023-07-06 12:30:28 +10:00
dd4f5d4630 Add 'available' filter for BuildLine API endpoint (#5186)
* Add 'available' filter for BuildLine API endpoint

- Fixes missing filter
- Closes https://github.com/inventree/InvenTree/issues/1839

* Bump API version
2023-07-06 12:18:26 +10:00
9abcc0ec34 Param fix (#5183)
* Handle AttributeError in convert_physical_value

* Added new unit test
2023-07-06 11:02:18 +10:00
831693e941 Stocktake external (#5182)
* Add 'location' filtering option for part.stock_entries

* Add "exclude_external" field to stocktake report

* Add "stocktake_exclude_external" default option

* Implement setting to exclude external stock

* Split stocktake functionality out into separate file

* Change name of internal setting

* Refactoring

* Add 'exclude_external' field to stocktake form
2023-07-05 22:53:44 +10:00
c91fbdbc48 use django-q2 (#5167)
* use django-q2

- Modern fork of django-q

* Update requirements.txt
2023-07-05 22:53:32 +10:00
3bea809823 Unit check option (#5175)
* Add option to control parameter units

* Check setting before validation

* Update part parameter settings page

* Update unit tests

* Update docs
2023-07-05 11:11:19 +10:00
cf0d30b11c add report feature for stock locations (#5134)
* add report feature for stock locations

* fix flake 8 errors

* run pre-commit run --all-files to fix style errors

* add new model

* create default stock location
2023-07-05 10:19:13 +10:00
9cf629ccc5 Add migration check for 0.12.0 database (#5174) 2023-07-05 10:07:48 +10:00
aec56d4b34 Bump general deps (#5170)
* bump deps

* down to py 3.9

* pin pillow
2023-07-05 07:20:56 +10:00
f16c8a5444 Update 2fa lib (#5169)
* remove CustomTwoFactorRemove

* add setting
2023-07-05 07:20:38 +10:00
83afa74927 Bump django - fix CVE-2023-36053 (#5168)
* bump deps - fix CVE-2023-36053

* downgrade to 3.9

* fix typo
2023-07-05 07:19:53 +10:00
7ba26ebfbb Task improvements (#5159)
* Ignore triggered events if plugin events are not enabled

* Ensure that plugin tasks are handled by the background worker

* Allow shell access

* Don't force async if testing

* Enable plugin events as part of CI

* fix
2023-07-04 23:26:19 +10:00
4c3dc6ddbd Restrict "recently updated" stock to "available" (#5165) 2023-07-04 22:53:46 +10:00
8b730884d7 Handle exception when creating default labels (#5163)
* Handle exception when creating default labels

- Running workers in parallel may cause race conditions
- Catch any exception which is raised

* Prevent password from being logged

* Update default timeout for docker
2023-07-04 22:46:03 +10:00
9ebbc2f9f6 Do not enforce unit type conversion for part parameters (#5160)
* Do not enforce unit type conversion for part parameters

- Still convert to "native value" (if possible)

* update unit tests
2023-07-04 21:57:43 +10:00
d52a839cf2 Handle case where git head is detached (#5161)
- branch information does not exist in this case
- Fixes https://github.com/inventree/InvenTree/issues/5133
2023-07-04 21:57:23 +10:00
637a0ca7a5 Remove old method (#5156)
- Now handled entirely by API / frontend
- Very inefficient, even if it was still being used
2023-07-04 20:52:42 +10:00
42fd4c7ee6 Query improvements for BuildLine table (#5153)
- Prefetch / preselect related records
- Improve query speed
2023-07-04 19:24:36 +10:00
17c2070503 Order table improvements (#5151)
- prevent "double loading" of order tables
2023-07-04 16:20:03 +10:00