Commit Graph

15268 Commits

Author SHA1 Message Date
Bobbe
a3dc3bdbf4
Use psycopg2 constants for isolation_level again (#6569) 2024-02-26 09:46:57 +11:00
Bobbe
2df0fd8a67
Move get_scheduled_tasks call into register_tasks function (#6556)
* Move get_scheduled_tasks call into register_tasks function

* Adjust scheduled_tasks tests

* Set scheduled_tasks default, Fix test_function
2024-02-24 14:27:47 +11:00
Oliver
d689b95963
Adjust config template (#6561)
- Remove very advanced options from default configuration
2024-02-23 02:17:26 +00:00
Matthias Mair
1fa64dd8cc
Fix tranlation pipeline (#6559)
* use default setup action

* small change to trigger CI

* use enviroment step

* define python version

* us uv a bit more

* clean diff

* globally define python version
2024-02-23 10:49:22 +11:00
Matthias Mair
6f0b2b31a8
Seperate CUI url paths and tests (#6543)
* move CUI JS files to CUI url section

* add flag to seperate CUI code and tests

* re-enable tests

* move urls back to backend patterns

* swap switch logic

* fix merge

* returning PUI paths if CUI not enabled

* revert test changes

* fix plugin settings url

* URL is not dependant on UI generation

* small fixes

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2024-02-22 22:56:50 +00:00
Matthias Mair
f5e02fd292
Switch to uv (#6499)
* test UV performance

* second dummy change

* fix CI

* set version - uv is already proving to be great

* dummy bump

* bump to newer uv

* use uv in more places

* revert uv

* add flag to disable UV

* fix vevn for CI

* bump uv version

* bump to uv-016

* bump

* bump

* switch to uv
2024-02-23 09:55:19 +11:00
Matthias Mair
5dbd3030d1
remove unused template tag (#6553) 2024-02-22 23:34:24 +11:00
Oliver
fdcbb68616
Fix for build output table (#6549)
- Correctly display passed test count
2024-02-22 00:05:46 +00:00
Oliver
6e713b15ae
[Feature] Engineering Units (#6539)
* Conversion: Support conversion from "engineering notation"

* Add unit tests for scientific notation

* Update docs for unit conversion
2024-02-21 23:22:23 +00:00
Lavissa
8bf614607c
Wrap theme parameters in memo (#6542) 2024-02-22 09:00:27 +11:00
Matthias Mair
c4d68aeef9
Dependabot/pip/cryptography 42.0.4 (#6545)
* Bump cryptography from 42.0.2 to 42.0.4

Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.2 to 42.0.4.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/42.0.2...42.0.4)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix merge

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-22 08:57:56 +11:00
Oliver
571b71f232
Retry table name query (#6540)
* Retry table name query

* Cleanup table names

* More cleanup
2024-02-21 14:11:56 +00:00
Oliver
defa03b83a
Update PartParameterTemplate API (#6538)
* Update PartParameterTemplate API

- Expose number of "parts" using a particular template
- Improve filtering visibility
- Update PUI table

* Update API version
2024-02-21 12:59:02 +00:00
Oliver
0bfbd45cec
API Tree filters (#6536)
* PartCategoryList: Add FilterSet class

* Update PartCategory filters

- Migrate all custom filtering to the FilterSet

* Logic updates

* Revert deleted code

* Implement similar filters for StockLocation list API

* Update API docs

* Unit test updates

* More fix

* Fix for StockLocation filterclass

* Fix PUI tables

* Cleanup CUI tables

* Updated unit tests
2024-02-21 23:34:20 +11:00
Oliver
a310437dc7
Bug fix for allocating items to build (#6532)
* Bug fix for allocating items to build

- Handle case where allocated quantity is less than 1
- Add unit tests
- Closes https://github.com/inventree/InvenTree/issues/6145

* Remove debug messgae
2024-02-21 10:35:26 +11:00
Lukas
7694092935
Added various PO fixes (#6483)
* Added various PO fixes

* Add auto-pricing and merge items functionality to PurchaseOrderLineItem

* Bump api version to v173

* Add po line item create/update tests
2024-02-21 09:03:32 +11:00
Oliver
55c64b546f
Locales fix (#6528)
* Fix for language select translation

- Function rather than const variable
- Allows for recalculation

* Hide pseudo language if not in dev mode
2024-02-21 08:38:47 +11:00
Oliver
68ba9653ef
Update devcontainer docs (#6527)
- Closes https://github.com/inventree/InvenTree/issues/6392
2024-02-20 21:03:26 +11:00
Oliver
567c7edbaf
Test template disable (#6526)
* Add new field to PartTestTemplate model

- 'enabled' field
- default = True (backwards compatibility)
- Allows tests to be disabled
- Retains test results but disables test

* Update PartTestTemplate API

- Expose new field
- Enable filtering by field

* CUI updates

- Add to PartTestTemplate table

* PUI: Update PartTestTemplateTable

* Update getRequiredTests

- By default, filter out tests which are "disabled"

* Update StockItemTestResult table

- Only display "enabled" tests
- Update CUI
- UPdate PUI

* Update existing build output table

* Bump API version

* Docs updates

* Updated unit tests
2024-02-20 10:01:59 +00:00
Lavissa
3eb1914f1e
Make API form Select Field theme-aware (#6521) 2024-02-20 11:33:56 +11:00
Lavissa
41f09f7578
Make Category tree theme-aware (#6523) 2024-02-20 11:32:19 +11:00
Matthias Mair
ebe01530e6
Bump CI/pre-commit versions (#6522)
* bump CI versions
and run new autofixes

* fix reqs
2024-02-20 10:47:57 +11:00
Oliver
6e932f85cf
Fix for clearable form fields (#6518) 2024-02-19 06:41:31 +00:00
Oliver
ed95cf2a8f
[CI] DB Migration Checks (#6517)
* Update imports

- Help prevent circular imports

* Run migration checks against 0.13.5
2024-02-19 06:30:40 +00:00
Oliver
3a52a1631d
[PUI] Tweaks (#6516)
* Enable editing "part" in PartTestTemplate

* Hide part if user is not staff

* API: allow filtering of templates by key

* Update API docs
2024-02-19 06:05:36 +00:00
Oliver
3b11a01966
[PUI] Notifications (#6515)
* Add placeholder buttons

* Add callback functions

- Mark all notifications as read
- Delete all read notifications

* remove unused import
2024-02-19 16:06:21 +11:00
Oliver
a74b29f059
Fixes for test result updates (#6514)
* Fix ordering of "stock" column in StockItemTable

* Handle table.activeFilters

- Can be passed undefined value in some cases

* Fix legacy test result table

- Add in "pass test" button

* Improve logic for creating templates

- Only look at ancestor parts *above* the existing part

* Update migration

- Only look above!

* Improve matching in template

* New data migration

- Fixes (probably rare) edge case in previous data migration

* Table tweak

- Embolden required test templates

* Add assertion check to data migration

* Update API version

- Add filter for "has_results" on the PartTestTemplate API endpoint

* Logic fix
2024-02-19 16:04:10 +11:00
Oliver
7dab02555d
Allow import of part images (#6513)
- Remove "readonly" attribute from image field
- Ref: https://github.com/inventree/InvenTree/issues/6511
2024-02-19 12:47:25 +11:00
Oliver
5f3932b7e1
Tweak PartParameterTable (#6512)
- Fix ordering of "name" field
2024-02-19 12:47:18 +11:00
Oliver
0f51127adf
[WIP] Test result table (#6430)
* Add basic table for stock item test results

* Improve custom data formatter callback

* Custom data formatter for returned results

* Update YesNoButton functionality

- Add PassFailButton with custom text

* Enhancements for stock item test result table

- Render all data

* Add placeholder row actions

* Fix table link

* Add option to filter parttesttemplate table by "inherited"

* Navigate through to parent part

* Update PartTestTemplate model

- Save 'key' value to database
- Update whenever model is saved
- Custom data migration

* Custom migration step in tasks.py

- Add custom management command
- Wraps migration step in maintenance mode

* Improve uniqueness validation for PartTestTemplate

* Add 'template' field to StockItemTestResult

- Links to a PartTestTemplate instance
- Add migrations to link existing PartTestTemplates

* Add "results" count to PartTestTemplate API

- Include in rendered tables

* Add 'results' column to test result table

- Allow filtering too

* Update serializer for StockItemTestResult

- Include template information
- Update CUI and PUI tables

* Control template_detail field with query params

* Update ref in api_version.py

* Update data migration

- Ensure new template is created for top level assembly

* Fix admin integration

* Update StockItemTestResult table

- Remove 'test' field
- Make 'template' field non-nullable
- Previous data migrations should have accounted for this

* Implement "legacy" API support

- Create test result by providing test name
- Lookup existing template

* PUI: Cleanup table

* Update tasks.py

- Exclude temporary settings when exporting data

* Fix unique validation check

* Remove duplicate code

* CUI: Fix data rendering

* More refactoring of PUI table

* More fixes for PUI table

* Get row expansion working (kinda)

* Improve rendering of subtable

* More PUI updates:

- Edit existing results
- Add new results

* allow delete of test result

* Fix typo

* Updates for admin integration

* Unit tests for stock migrations

* Added migration test for PartTestTemplate

* Fix for AttachmentTable

- Rebuild actions when permissions are recalculated

* Update test fixtures

* Add ModelType information

* Fix TableState

* Fix dataFormatter type def

* Improve table rendering

* Correctly filter "edit" and "delete" buttons

* Loosen requirements for dataFormatter

* Fixtures for report tests

* Better API filtering for StocokItemTestResult list

- Add Filter class
- Add option for filtering against legacy "name" data

* Cleanup API filter

* Fix unit tests

* Further unit test fixes

* Include test results for installed stock items

* Improve rendering of test result table

* Fix filtering for getTestResults

* More unit test fixes

* Fix more unit tests

* FIx part unit test

* More fixes

* More unit test fixes

* Rebuild stock item trees when merging

* Helper function for adding a test result to a stock item

* Set init fix

* Code cleanup

* Cleanup unused variables

* Add docs and more unit tests

* Update build unit test
2024-02-18 23:26:01 +11:00
Miklós Márton
ad1c1ae604
Add option to disable the build output completion if are tests not passed (#6057)
* Add option to disable the build output completion if required tests not passed

Fixes #5037

* Fix review comments

* Added tests

* Add settinsg option to PUI

* Utilize F" string concatenation

* Add validation to serializer too to being able to generate proper error message in the case if multiple outputs having incomplete tests

* Fix other build tests failing because of the new stock items

* Remove len from array empty check

* Update serializers.py

* Update models.py

Simplify error message

* Update settings.py

Formatting fix

* Update models.py

More style fixes

* Update models.py

Remove empty line

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2024-02-18 10:28:37 +11:00
Michael
7adf2e0835
Added doc for status_label to context variables (#6507) 2024-02-18 09:00:31 +11:00
Matthias Mair
a1eb3623ba
fix bash syntax (#6505) 2024-02-16 18:33:29 +11:00
Oliver
7681cd2c44
Default site (#6503)
* Allow simpler setting for CSRF_TRUSTED_ORIGINS and CORS_ALLOWED_ORIGINS

- If these are not specified by the user, but a SITE_URL *is* specified, then use that

* Update docs

* Update config.md

Remove outdated notes
2024-02-16 15:14:55 +11:00
Oliver
e88defd026
Revert custom temp definition (#6502) 2024-02-16 01:22:05 +00:00
Oliver
d9b769d27b
Fix broken URL (#6497) 2024-02-16 11:01:08 +11:00
Oliver
04261dbcac
Provide a *copy* of the page context to pass to plugin (#6496) 2024-02-16 11:00:51 +11:00
Oliver
43457d4136
Support degree symbols for temperature units (#6498) 2024-02-16 11:00:17 +11:00
Oliver
21f209f7cc
Forms actions fix (#6493)
* Handle case where OPTIONS.actions is not present

* Specify stock.change permission

* Hide table button based on user permission

* Fix for permission check class
2024-02-16 08:47:05 +11:00
Oliver
38fac47e39
New Crowdin updates (#6490)
* updated translation base

* Fix: New translations django.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Fix: New translations messages.po from Crowdin

* Clean translation

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-15 23:17:24 +11:00
Lukas
8807492db6
Fix settings typing and use generics from standard collection (#6487)
* Fix settings typing and use generics from standard collection

* Fix docstring
2024-02-15 22:44:32 +11:00
Lukas
35577fad41
Added pdf2image kwargs (#6488)
* Added pdf2image kwargs

* Added direct use_cairo arg and make it default enabled

* Fix docs

* Fix docs

* Fix docs

* Fix docs
2024-02-15 20:53:54 +11:00
Oliver
5af6b92f90
Fix retry time for Q_CLUSTER (#6489)
- Ensure it is *greater* than timeout
2024-02-15 11:36:14 +11:00
Oliver
5ca007a184
Move CurrencyTable to admin center (#6484) 2024-02-14 14:49:24 +00:00
Oliver
0e1923a90c
Handle error on logout (#6482)
* Handle error on logout

- Logout failure redirects to login page

* Handle case if user is undefined when fetching role data

* Cleanup error messages

* More error message cleanup
2024-02-14 14:17:01 +00:00
Lukas
aa7eaaab3a
Machine integration (#4824)
* Added initial draft for machines

* refactor: isPluginRegistryLoaded check into own ready function

* Added suggestions from codereview

* Refactor: base_drivers -> machine_types

* Use new BaseInvenTreeSetting unique interface

* Fix Django not ready error

* Added get_machines function to driver

- get_machines function on driver
- get_machine function on driver
- initialized attribute on machine

* Added error handeling for driver and machine type

* Extended get_machines functionality

* Export everything from plugin module

* Fix spelling mistakes

* Better states handeling, BaseMachineType is now used instead of Machine Model

* Use uuid as pk

* WIP: machine termination hook

* Remove termination hook as this does not work with gunicorn

* Remove machine from registry after delete

* Added ClassProviderMixin

* Check for slug dupplication

* Added config_type to MachineSettings to define machine/driver settings

* Refactor helper mixins into own file in InvenTree app

* Fixed typing and added required_attributes for BaseDriver

* fix: generic status import

* Added first draft for machine states

* Added convention for status codes

* Added update_machine hook

* Removed unnecessary _key suffix from machine config model

* Initil draft for machine API

* Refactored BaseInvenTreeSetting all_items and allValues method

* Added required to InvenTreeBaseSetting and check_settings method

* check if all required machine settings are defined and refactor: use getattr

* Fix: comment

* Fix initialize error and python 3.9 compability

* Make machine states available through the global states api

* Added basic PUI machine admin implementation that is still in dev

* Added basic machine setting UI to PUI

* Added machine detail view to PUI admin center

* Fix merge issues

* Fix style issues

* Added machine type,machine driver,error stack tables

* Fix style in machine/serializers.py

* Added pui link from machine to machine type/driver drawer

* Removed only partially working django admin in favor of the PUI admin center implementation

* Added required field to settings item

* Added machine restart function

* Added restart requird badge to machine table/drawer

* Added driver init function

* handle error functions for machines and registry

* Added driver errors

* Added machine table to driver drawer

* Added back button to detail drawer component

* Fix auto formatable pre-commit

* fix: style

* Fix deepsource

* Removed slug field from table, added more links between drawers, remove detail drawer blur

* Added initial docs

* Removed description from driver/machine type select and fixed disabled driver select if no machine type is selected

* Added basic label printing implementation

* Remove translated column names because they are now retrieved from the api

* Added printer location setting

* Save last 10 used printer machine per user and sort them in the printing dialog

* Added BasePrintingOptionsSerializer for common options

* Fix not printing_options are not properly casted to its internal value

* Fix type

* Improved machine docs

* Fix docs

* Added UNKNOWN status code to label printer status

* Skip machine loading when running migrations

* Fix testing?

* Fix: tests?

* Fix: tests?

* Disable docs check precommit

* Disable docs check precommit

* First draft for tests

* fix test

* Add type ignore

* Added API tests

* Test ci?

* Add more tests

* Added more tests

* Bump api version

* Changed driver/base driver naming schema

* Added more tests

* Fix tests

* Added setting choice with kwargs and get_machines with initialized=None

* Refetch table after deleting machine

* Fix test

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2024-02-14 14:13:47 +00:00
Oliver
aed7754bc2
Fix for AttachmentTable (#6481)
* Fix for AttachmentTable

- Rebuild actions when permissions are recalculated

* Update examples.md
2024-02-15 00:45:33 +11:00
Michael
d86f964fb1
Add BOM creation to the sofa example (#6477)
* Add BOM creation to ther sofa example

* Fixed typo

* Update examples.md

Cleanup wording a bit

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2024-02-14 17:28:13 +11:00
Oliver
3637b28da7
Remove maintenance mode wrapper from plugin loading (#6479) 2024-02-14 13:22:38 +11:00
Matthias Mair
825366f684
fix schema path (#6474) 2024-02-13 08:01:37 +01:00