2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 03:26:45 +00:00

16195 Commits

Author SHA1 Message Date
Oliver
cc6a2f4548
Re-render panels when context changes (#8407) 2024-11-02 11:59:40 +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
feefa60a8f
Fix image size restriction in PageDetail header (#8398) 2024-10-31 13:13:50 +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
dependabot[bot]
a826096e37
Bump the dependencies group across 1 directory with 3 updates (#8382)
* Bump the dependencies group across 1 directory with 3 updates

Bumps the dependencies group with 3 updates in the /docs directory: [mkdocs-git-revision-date-localized-plugin](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin), [mkdocs-include-markdown-plugin](https://github.com/mondeja/mkdocs-include-markdown-plugin) and [mkdocs-macros-plugin](https://github.com/fralau/mkdocs_macros_plugin).


Updates `mkdocs-git-revision-date-localized-plugin` from 1.2.9 to 1.3.0
- [Release notes](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/releases)
- [Commits](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/compare/v1.2.9...v1.3.0)

Updates `mkdocs-include-markdown-plugin` from 6.2.2 to 7.0.0
- [Release notes](https://github.com/mondeja/mkdocs-include-markdown-plugin/releases)
- [Commits](https://github.com/mondeja/mkdocs-include-markdown-plugin/compare/v6.2.2...v7.0.0)

Updates `mkdocs-macros-plugin` from 1.3.6 to 1.3.7
- [Release notes](https://github.com/fralau/mkdocs_macros_plugin/releases)
- [Changelog](https://github.com/fralau/mkdocs-macros-plugin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fralau/mkdocs_macros_plugin/compare/v1.3.6...v1.3.7)

---
updated-dependencies:
- dependency-name: mkdocs-git-revision-date-localized-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
- dependency-name: mkdocs-include-markdown-plugin
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: dependencies
- dependency-name: mkdocs-macros-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
...

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

* fix req

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
2024-10-29 21:45:39 +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
178f939e42
Update docker_install.md (#8387) 2024-10-29 09:33:07 +11:00
Michael
6fc9c7b0ec
Add example for INVENTREE_CUSTOMIZE environment variable (#8314)
* Add example for INVENTREE_CUSTOMIZE environment variable

* Search also for IPN in allocated parts for build

* Changed example
2024-10-29 09:07:58 +11:00
Oliver
89946aed15
[PUI] Search tweak (#8381)
* Cleanup buttons and add Tooltip

* Clearer separation

* Link cleanup
2024-10-29 01:31:19 +11:00
Oliver
234ee2b40f
Add "received" filter to PurchaseOrderLineTable (#8377) 2024-10-28 17:39:37 +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
21ab1a184d
Invoke docs (#8373)
* Add separate docs page for invoke

* More info on available tasks

* More info

* Strict mode is strict
2024-10-27 10:51:51 +11:00
Oliver
9fd882f95e
[PUI] Task table enhancements (#8369)
* Refresh task counts when updating tables

* Handle case where error is null
2024-10-26 12:40:24 +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
Oliver
075b62757a
Bug fix for auto-allocation against build order (#8359) 2024-10-25 15:54:11 +11:00
Oliver
15cf8591b3
Fix dev docs (#8357) 2024-10-25 09:37:50 +11:00
Oliver
662cf7da3b
Log failed task (#8333)
* Bug fix for build models

* Notify staff users when a background task fails

* Improve object lookup for notification

* Handle url reversal error case

* Add unit testing
2024-10-24 22:15:01 +11:00
github-actions[bot]
6bf9a97f52
New Crowdin translations by GitHub Action (#8348)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-10-24 21:15:17 +11:00
Oliver
328472701d
[PUI] Machines table refactor (#8352)
* Reorganize MachineManagementPanel

- Use Accordion
- More consistent with PluginManagementPanel

* Code cleanup

* Refactor machine drawer display

* Refactor MachineTypeDetailDrawer
2024-10-24 15:24:52 +11:00
Matthias Mair
9f9afa1593
bump dev deps (#8336) 2024-10-24 14:39:29 +11:00
Oliver
556ff4f15b
Settings validation enhancements (#8351)
* Enforce lower case for model name checks

* Enhance settings validation

- Add support for "float" settings type
- Improve validation code and error handling
2024-10-24 13:12:39 +11:00
Oliver
fb17dcce9a
Task group (#8332)
* Add 'group' to offload_task

- Make use of 'group' field in AsyncTask model
- Allows better db filtering

* Log error if low_stock check cannot be performed

* Ensure low-stock checks are performed by the background worker

* Change encoding of arguments to 'notify_low_stock_if_required'

- Pass part ID, not part instance
- Safer, but requires DB hit

* Fix typo

* Fix to allow tests to run
2024-10-24 00:06:44 +11:00
Oliver
ba3bac10a7
PUI: Show "Return from customer" option (#8345)
* PUI: Show "Return from customer" option

* Extend playwright tests

* Additional unit tests
2024-10-23 23:24:21 +11:00
dependabot[bot]
46cbdac6ba
Bump the dependencies group across 1 directory with 2 updates (#8327)
* Bump the dependencies group across 1 directory with 2 updates

Bumps the dependencies group with 2 updates in the /docs directory: [mkdocs-macros-plugin](https://github.com/fralau/mkdocs_macros_plugin) and [mkdocs-material](https://github.com/squidfunk/mkdocs-material).


Updates `mkdocs-macros-plugin` from 1.3.5 to 1.3.6
- [Release notes](https://github.com/fralau/mkdocs_macros_plugin/releases)
- [Changelog](https://github.com/fralau/mkdocs-macros-plugin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fralau/mkdocs_macros_plugin/compare/v1.3.5...v1.3.6)

Updates `mkdocs-material` from 9.5.40 to 9.5.42
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.5.40...9.5.42)

---
updated-dependencies:
- dependency-name: mkdocs-macros-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
...

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

* fix req

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
2024-10-23 16:11:29 +11:00
github-actions[bot]
aa1e23d455
New Crowdin translations by GitHub Action (#8266)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-10-23 16:10:59 +11:00
simonkuehling
5ed0af20c8
use LABEL_DEFAULT_PRINTER user setting to pre-select plugin in label printing forms (#8330) 2024-10-23 15:18:02 +11:00
Oliver
a6bba144e7
Part pricing cleanup (#8340)
* Part pricing cleanup

- Improve / tweak rendering for PurchaseHistoryPanel

* Adjust playwright tests
2024-10-23 14:33:42 +11:00
Oliver
28146bbbf0
Fix display of purchase order lines (#8339) 2024-10-23 14:33:31 +11:00
Oliver
295f733ed9
Add "active" field to SupplierPart form (#8341)
- Previously missing from legacy interface
2024-10-23 12:55:25 +11:00
Oliver
bcc991198e
CUI: Fix for part pricing panel (#8338) 2024-10-23 11:00:02 +11:00
Matthias Mair
8d27144f78
bump container deps (#8337) 2024-10-23 09:52:35 +11:00
dependabot[bot]
66c37d7aeb
Bump anchore/sbom-action from 0.17.3 to 0.17.4 in the dependencies group (#8325)
Bumps the dependencies group with 1 update: [anchore/sbom-action](https://github.com/anchore/sbom-action).


Updates `anchore/sbom-action` from 0.17.3 to 0.17.4
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Changelog](https://github.com/anchore/sbom-action/blob/main/RELEASE.md)
- [Commits](f5e124a5e5...8d0a6505bf)

---
updated-dependencies:
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
2024-10-23 09:06:06 +11:00
Oliver
cbe547b873
Add "View Part" action in BuildLineTable (#8335) 2024-10-23 07:16:38 +11:00
Oliver
ca31bb0322
[API] Sales order filters (#8331)
* Fix 'allocated' queryset annotation for SalesOrderLineItemSerializer

* Add 'allocated' filter for SalesOrderLineItemList

* Allow ordering by 'allocated' and 'shipped' values

* Updated unit testing

* Bump API version

* Update playwright tests
2024-10-23 07:16:26 +11:00
Oliver
2adb41f448
Hide "allocations" tab for items which are not in stock (#8334) 2024-10-23 07:16:14 +11:00
Oliver
cb0248d159
Markdown link fix (#8328)
* Improve cleaning of markdown content

* Update unit test with new check
2024-10-22 13:06:43 +11:00
Oliver
ddea9fa4b9
[PUI] Platform fixes (#8324)
* Add "IPN" column to build order allocated stock table

* Allow sorting and searching by IPN

* Handle allocations where allocated but required == 0

* Add "no info available" message to part scheduling

* Adjust PartSchedulingTable

* Icon fix

* Add "latest serial number" information to PartDetail page

* Cleanup code for serial-number placeholder in forms

* Logic fix for displaying non-unity pack quantity

* Fix description field on SupplierPart page

* Fix duplicate table column
2024-10-22 12:17:24 +11:00
Oliver
e219b7c914
Add documentation about user management (#8321) 2024-10-21 10:05:23 +11:00
Oliver
90f726e325
[PUI] Tweaks for part purchase order table (#8319)
* Improve API query

* Table ordering fixes for PartPurchaseOrdersTable
2024-10-20 15:01:05 +11:00
Oliver
29726d8d0d
Refactoring / Enhancements (#8307)
* Create simply PartSalesPanel component

* Updates

* Add API endpoint for SalesHistory

- And serializers
- Basic, needs lots of work still

* Fix for PartDetail page

* SalesOrder page updates

* More page updates

* Update API endpoint

* Backend improvements

* add API endpoint

* Front-end rendering

* Make frontend generic

* Fix for CompanyTable

* Make back-end API more generic

* More API improvements

* Implement history for purchasing

* API / UI fixes

* Remove debug statements

* Support file download

* Add endpoint for build order history

* Implement UI for build order history

* Revert backend

* Revert frontend

* Remove unsed imports

* Cleanup permission checks

* Bump API version

* Improve token management code

- Do not request token if other cookies are unavailable
- Do not fetch user data if token is unavailable
- Prevents connection error logs

* Fix for CompanyTable - onRowClick
2024-10-20 12:48:29 +11:00
Matthias Mair
16d0fb4798
bump pre-commit (#8318) 2024-10-20 12:06:05 +11:00
Oliver
5f905aab9d
Fix breadcrumb for <BuildOrderDetail /> (#8305)
* Fix breadcrumb for <BuildOrderDetail />

* Add delay for playwright tests
2024-10-18 15:24:20 +11:00
Oliver
17bf7bb5e3
[Plugin] Enhancements for serial number validation (#8311)
* Error handling for plugin.increment_serial_number

* Improve error handling for plugin validation functions

* Add Part.get_next_serial_number method

- Simplify call for incrementing

* ValidationMixin: add "part" to increment_serial_number func

* Pass part information through to serial number functions

* Fix circular imports

* Allow "get_latest_serial_number" to use plugin system

* Better working example for plugin sample

* Update SampleValidatorPlugin

* Fix indent

* Add code comment

* Cleanup code logic

* Revert previous commit

* Update unit tests
2024-10-18 13:45:35 +11:00