2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 03:56:43 +00:00

662 Commits

Author SHA1 Message Date
Oliver
e2e0ecc674
Remove dummy migration file (#8537) 2024-11-22 09:51:44 +11:00
Jacob Felknor
94089c94b7
Add PO wildcard default setting (#8532)
* add PO wildcard default setting

* Revert "add PO wildcard default setting"

This reverts commit 6cc577fa733709fe6b38f2f63244ebcb9a1fb8e5.

* use custom format spec for "wildcard with default" reference pattern

* add wildcard with default to docs

* add test for wildcard with default
2024-11-22 09:27:06 +11:00
github-actions[bot]
6250901c2f
New Crowdin translations by GitHub Action (#8491)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-21 15:00:52 +11:00
Oliver
01aa8bb2ba
Plugins installation improvements (#8503)
* Append plugins dir to pythonpath

* Error handling in plugin helpers

* Install plugin into "plugins" directory

* Use plugins dir when installing from plugins.txt

* Implement removal of plugin from plugins dir

* Remove the dist-info dirs too

* Cleanup

* Catch errors

* Specify plugin location for CI

* Remove plugins.txt support

* Improve regex for plugin matching

* Revert "Remove plugins.txt support"

This reverts commit 02783503513673574255bd1a809ce17c6f0cee6c.

* Remove PLUGIN_ON_STARTUP support

* Better error catching for broken packages

* Cleanup

* Revert "Cleanup"

This reverts commit a40c85d47d9446cf4181b9865d2fce6a63efba92.

* Improved exception handling for plugin loading

* More logging

* Revert uninstall behaviour

* Revert python path update

* Improve check for plugins file

* Revert check on startup

* Better management of plugins file

- Use file hash to determine if it should be reloaded

* Fix docstring

* Update unit tests

* revert gh env

* No cache

* Update src/backend/InvenTree/plugin/installer.py

Co-authored-by: Matthias Mair <code@mjmair.com>

* Use hashlib.file_digest

* Remove --no-cache-dir

* Revert "Use hashlib.file_digest"

This reverts commit bf84c8155e6036da0a529acba44386fed982ae8e.

* Add note for future selves

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2024-11-21 07:38:26 +11:00
Oliver
41a9b6897a
Cleanup format_number (#8529)
-  Removed unused line
2024-11-20 12:26:13 +11:00
Matthias Mair
4aa7c59f5b
Bump backend linting deps (#8526)
* upgrade deps

* bump eslint
2024-11-20 08:54:37 +11:00
Oliver
7fcf068f05
Relation update (#8524)
* Add "note" field to PartRelated model

* Improved API

* Add field to serializer

* Implement in RelatedPartTable

* Bump API version
2024-11-20 08:54:19 +11:00
Matthias Mair
e4a39692ff
Add structlog (#7937)
* Add structlog
Closes #3960

* fix formatting

* make log writing optional

* ignore logfiles

* fix variable naming
2024-11-19 19:48:20 +11:00
Oliver
03c3417841
[Refactor] Remove 'test statistics' (#8487)
* [Refactor] Remove 'test statistics'

* Bump API version
2024-11-19 01:05:38 +11:00
Oliver
6bf6733268
UI link fix (#8508)
* Add tags to test if CUI or PUI are enabled

* Fix PUI redirect
2024-11-18 11:32:33 +11:00
Oliver
3037243de2
Small tweak to plugin staticfile collection output (#8498) 2024-11-16 15:38:07 +11:00
Jacob Felknor
f9d3f43b02
configurable ldap group classes (#8475)
* configurable ldap group classes

* remove accidental duplicate line

* fix style issues

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2024-11-16 09:08:27 +11:00
dependabot[bot]
6fcd691070
Bump @eslint/plugin-kit from 0.2.0 to 0.2.3 in /src/backend (#8492)
Bumps [@eslint/plugin-kit](https://github.com/eslint/rewrite) from 0.2.0 to 0.2.3.
- [Release notes](https://github.com/eslint/rewrite/releases)
- [Changelog](https://github.com/eslint/rewrite/blob/main/release-please-config.json)
- [Commits](https://github.com/eslint/rewrite/compare/core-v0.2.0...plugin-kit-v0.2.3)

---
updated-dependencies:
- dependency-name: "@eslint/plugin-kit"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-16 08:38:50 +11:00
Oliver
fbe222f6eb
Fix for "installed in" display (#8480)
* Fix for "installed in" display

- Allow "details" field to be passed custom params

* Add extra debug to link checking

* API: fix for StockTrackingList entry

* Display links for stock items in tracking entry table

* Generate absolute links for item renderers

* Revert "Generate absolute links for item renderers"

This reverts commit 878fba91d0d689f49dfdee964827227fe574a66b.

* Bump API version

* Add playwright tests
2024-11-15 23:28:47 +11:00
github-actions[bot]
7a3bed5b40
New Crowdin translations by GitHub Action (#8455)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-15 12:10:55 +11:00
Oliver
da112211e5
Format number (#8482)
* Add extra options for 'format_number' helper

* Update documentation

* Improved typing hints and docs cleanup

* Fix link
2024-11-14 16:11:01 +11:00
Oliver
246f17113f
Fix for locate item plugins (#8473)
* A hook for caching active plugins

* Add LocateItemButton

* Implement "locate" button for location detail page too

* Fix for StockApiMixin.get_serializer

- Recent refactoring removed 'path_detail' attribute

* Fix offloading of 'locate'

* Remove debug msg

* Add custom message

* Remove force_async call

* Add playwright tests
2024-11-13 06:49:48 +11:00
Oliver
113b9e9fd9
CUI: Fix for navbar logo (#8472)
- Closes https://github.com/inventree/InvenTree/pull/6901
2024-11-12 22:36:12 +11:00
Oliver
1eae56ff1e
Catch invalid decimal conversion (#8470)
- Thanks to  fuzzers reported by sentry.io
2024-11-12 19:56:00 +11:00
Oliver
9ab532a067
Improve null checks for SalesOrder.shipment (#8469) 2024-11-12 19:55:49 +11:00
Matthias Mair
9cd0394dc4
Remove unneeded AjaxView usage (#8461)
* remove unneeded AjaxView usage

* add schema

* bump schema version

* make schema more acurate

* exclude not found view

* make script also axept base api
2024-11-11 09:11:20 +11:00
Oliver
255a5d083e
[PUI] Part allocations (#8458)
* Add new backend filters for BuildLine API

* PUI: Better display of part allocations against build orders

* Add 'order_outstanding' filter to SalesOrderLineItem API

* Add new table showing outstanding SalesOrder allocations against a part

* Update playwright test

* Cleanup

* Bump API version

* Add more table columns

* Tweak UsedInTable

* Another table tweak

* Tweak playwright tests
2024-11-09 20:22:26 +11:00
github-actions[bot]
a8e833a226
New Crowdin translations by GitHub Action (#8436)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-08 23:05:35 +11:00
Oliver
2c294d6ebe
Sales order improvements (#8445)
* Migration for SalesOrderAllocation

- Allow allocation against order with null shipment

* Enhaced query efficiency

* Further API cleanup

* Adjust serializer

* PUI updates

* Enable editing of allocation shipment

* Improve shipment filtering

* Add sub-table for salesorderlineitem

* Add helper method to SalesOrder to return pending SalesOrderAllocations

* Fix for CUI

* Update form for CUI

* Prevent SalesOrder completion with incomplete allocations

* Fixes for StockItem API

* Frontend refactoring

* Code cleanup

* Annotate shipment information to SalesOrder API endpoint

* Update frontend PUI

* Additional filtering for SalesOrderAllocation

* Bump API version

* Hide panel based on user permissions

* js linting

* Unit test fix

* Update playwright tests

* Revert diff

* Disable playwright test (temporary)

* View output from build table
2024-11-08 23:05:24 +11:00
Matthias Mair
cd9f491dc6
Remove coupling of tests to cui (#8389)
* remove coupling of tests to cui

* all testing for PUI absolute urls

* remove overlapping test

* refactor middleware check

* move static things into global

* factor out test target

* re-add api exception

* keep using settings.js for now
2024-11-08 19:36:33 +11:00
Oliver
011108cb50
Adjustments to default template file (#8440)
* Adjustments to default template file

- Do not specify SAMESITE_COOKIE options by default
- Fallback to the values in settings.py

* Update config_template.yaml
2024-11-08 10:50:13 +11:00
Oliver
e46ae1a4e6
Enable ordering of BomList by 'reference' (#8437) 2024-11-06 10:29:16 +11:00
Oliver
245803b0d4
[PUI] Updates for AdminButton (#8434)
* [PUI] Updates for AdminButton

- Hide if django admin interface is disabled
- Use correct admin URL

* Adjust InfoView

* Add playwright tests
2024-11-06 09:27:43 +11:00
github-actions[bot]
b4310bf91e
New Crowdin translations by GitHub Action (#8412)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-04 22:33:04 +11:00
Oliver
4df42cd776
PO receive fix (#8423)
* Add "active" filter to PurchaseOrderLineItem.part field

* Fix for allocation serial numbers to incoming items

* Validate serial numbers per line item
2024-11-04 14:10:17 +11:00
Oliver
c9079d9a0e
Ignore MissingRate errors (#8420)
* Improved permission checking for data importing

- Permission checks on the imported model type

* Improved validation for DateField

* Ignore MissingRate errors

- Do not send these to sentry
2024-11-03 18:23:34 +11:00
Oliver
abad36786f
Importer permissions (#8419)
* Improved permission checking for data importing

- Permission checks on the imported model type

* Improved validation for DateField

* Fix for unit test
2024-11-03 17:43:09 +11:00
Oliver
504655c92d
Fix for potential MissingKey error (#8422) 2024-11-03 17:42:24 +11:00
Oliver
b25b3493d9
Remove unnecessary code (#8418) 2024-11-03 13:05:04 +11:00
Oliver
546bd945fc
Logic fix for build output creation (#8417) 2024-11-03 13:04:55 +11:00
Oliver
d1c2213836
Offload initial email task (#8413)
- Prevent blocking on email task
- Allow worker to try multiple times
- Don't pass 500 error back to form validation
2024-11-03 09:56:28 +11:00
github-actions[bot]
d11b7d3a7c
New Crowdin translations by GitHub Action (#8355)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-02 21:46:12 +11:00
Oliver
6cca66cafa
More error logging during plugin loads (#8408)
- Ensure all errors are logged
2024-11-02 21:09:49 +11:00
Oliver
18e5b0df58
[PUI] Dashboard refactor (#8278)
* Refactor plugin components into <RemoteComponent />

* Clean up footer

* Allow BuildOrder list to be sorted by 'outstanding'

* Fix model name

* Update BuildOrderTable filter

* Add StockItemTable column

* Working towards new dashboard

* Cleanup unused imports

* Updates: Now rendering some custom widgets

* Define icons for model types

* Add icon

* Cleanup / refactor / delete

- Complete transfer of files into new structure

* Follow link for query count widgets

* Add some more widgets to the library

* Remove old dashboard link in header

* Remove feedback widget

* Bump API version

* Remove test widget

* Rename "Home" -> "Dashboard"

* Add some more widgets

* Pass 'editable' property through to widgets

* Cleanup

* Add drawer for selecting new widgets

* Allow different layouts per user on the same machine

* Fixes

* Add ability to *remove* widgets

* Add helpful button

* Add a keyboard shortcut

* Refactoring

* Add backend code for serving custom dashboard items

* Load dashboard items from plugins

* Tweak for dashboard item API query

- Refetch if user changes
- Tweak "loaded" value
- Prevent refetchOnMount

* Add message if no dashboard widgets are displayed

* Refactoring main navigation menu

- Group into sections
- Cleanup / consolidation
- General refactoring

* Remove playground

* Add backend field for storing dashboard layout

* Add extra type definitions for UseInstance

* Manual labels for builtin dashboard items

- Otherwise they will change with translation locale

* Shorten labels for more plugins

* Adjust DashboardMenu

* Reduce stored data

* Add widget filter by text

* Remove back-end settings

* Update playwright tests for dashboard

* Updated tests

* Refactor backend API for fetching plugin features

* Further fixes for back-end code

* More back-end fixes

* Refactor frontend:

- Custom panels
- Custom dashboard items

* Further backend fixes

* Yet more backend fixes

- Improve error handling

* Fix for custom plugin settings rendering

* Enable plugin panels for part index and stock index pages

* Cleanup

* Fix nav menu

* Update typing

* Helper func to return all plugin settings as a dict

* Update API version date

* Fix for UseInstancea

* typing fix

* Tweak layout callbacks

* Pass query parameters through to navigation functions

* Improve custom query display

* Add "news" widget

* Ensure links are prepended with base URL on receipt

* Update NewsWidget

* Bug fix

* Refactor template editor tests

* Refactor unit testing for test_ui_panels

* Unit test for dashboard item API endpoint

* Update comment

* Adjust playwright tests

* More playwright fixes

* Hide barcode scanning options if disabled

* Tweak dashboard widget

* Fix custom panel title

* Update documentation around UIMixin class

* Cleanup

* Additional docs

* Add icon def for 'error' ModelType

* Add error boundary to TemplateEditor component

* Fix so that it works with template editors and previews again

* Tweak error messages

* API unit test fixes

* Unit test fix

* More unit test fixes

* Playwright test tweaks

* Adjust error messages
2024-11-02 08:48:29 +11:00
Oliver
c4031dba7f
Purchase Order Destination (#8403)
* Add "destination" field to PurchaseOrder

* Add 'destination' field to API

* Add location to PurchaseOrderDetail page

* Display "destination" on PurchaseOrderDetail page

* Pre-select location based on selected "destination"

* Fix order of reception priority

* Auto-expand the per-line destination field

* Add "Purchase Order" detail to StockItemDetail page

* Bug fix in PurchaseOrderForms

* Split playwright tests

* Docs updates

* Bump API version

* Unit test fixes

* Fix more tests

* Backport to CUI

* Use PurchaseOrder destination when scanning items
2024-11-01 11:10:25 +11:00
Oliver
871cd905f1
[PUI] Table refactor (#8395)
* Refactor table header items out into new file

* Improve BomItem API query

* Allow table header to be removed entirely

* revert BomTable

* Re-add "box" component

* Reimplement partlocked attribute

* Fix for PartDetail

- Revert to proper panels

* Updated playwright tests

* Additional tests
2024-11-01 07:23:26 +11:00
Oliver
801b32e4e3
Prevent multiple background workers without global cache (#8401)
* Prevent multiple background workers without global cache

* Documentation updates

- New page dedicated to InvenTree process stack
- Update links
- Consolidate information

* Update mkdocs.yml
2024-11-01 07:23:08 +11:00
Oliver
913a05cf45
[Bug] Fix for create_child_builds (#8399)
* Fix for create_child_builds

- Account for concurrency between multiple worker processes
- Ensure db commits are atomic
- Add random delays between build creation

* Check for existing build order

* Initially force  task off to background worker

* Revert force_async change
2024-10-31 13:59:53 +11:00
Oliver
8822194b0d
[PUI] stock table (#8396)
* [PUI] Add extra fields to StockItemTable

* Add SKU and MPN to StockItem export data

* Enable sorting

* Bump API version
2024-10-31 12:34:28 +11:00
Oliver
8a7a2da07b
[PUI] notifications fix (#8392)
* Include actual model name in notification repot

* Include model_id in API

* Refactoring for NotificationDrawer

- Add error boundary
- Separate rendering func for individual entry
- Allow router navigation
- Better link introspection
- Add tooltip for notification description

* Add URL support for errors

* Allow navigation to an individual error in the admin center

* Updates

* Add rendering method for 'error' model type
2024-10-29 15:00:34 +11:00
Oliver
40f456fbc9
[PUI] Build allocation sub tables (#8380)
* Add helpers methods for table row expansion

* Render a simplified "line item sub table"

- Akin to CUI implementation
- But like, better...

* Edit / delete individual stock allocations

* Improvements for BuildLineTable and BuildOutputTable

* Improvements for table fields

* Refactoring

* Refactor BuildLineTable

- Calculate and cache filtered allocation values

* Code cleanup

* Further fixes and features

* Revert new serializer field

- Turns out not to be needed

* Add playwright tests

* Bug fix for CUI tables

- Ensure allocations are correctly filtered by output ID

* Adjust CUI table
2024-10-29 11:36:32 +11:00
Oliver
6953640161
[Bug] Fix issue with build order lines table (#8376)
* Revert change to BuildItem API

- Requires "allocations" for build output table
- Probably can refactor this later

* Bug fix for BuildOutputTable in PUI

- Correct calculation for "fully allocated"

* Adjust annotations for serializer

* Bump API version
2024-10-28 17:06:09 +11:00
Oliver
3253a4a93c
[Bug] Ensure links are prepended with base URL on receipt (#8367)
* Ensure links are prepended with base URL on receipt

* Bug fix
2024-10-26 12:40:14 +11:00
Oliver
331692bb46
Notifications fix (#8360)
* Fix for app loading

- Allow collection for background worker too

* Improved logging

* Refactor MethodStorageClass

- Cache methods more intelligently
- Re-collect if null
2024-10-25 18:00:32 +11:00
Oliver
6be6c4b42f
[WIP] Build line filter fix (#8343)
* Remove 'allocations' from BuildLineSerializer

- Expensive to have a "many" serializer automatically used
- Adjust existing tables accordingly
- Fetch on demand

* WIP: Add some unit tests

* Adjust BuildLine queryset annotation

- Multi-level annotation proves to be very expensive
- Reduce complexity, save a bunch of time on queries
- Remove 'total_allocated_stock' field
- Adjust API query filter

* Optimize query by deferring certain fields

* Further query refinements

* Bump API version
2024-10-25 15:54:20 +11:00