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
075b62757a
Bug fix for auto-allocation against build order (#8359) 2024-10-25 15:54:11 +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
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
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
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
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
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
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
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
Oliver
c9a4e6bf7d
Fix for add_tracking_entry in build.create_output (#8310)
- Also add new end-to-end unit tests
2024-10-18 11:41:04 +11:00
Oliver
d58d34af25
[CUI] Shipment fixes (#8309)
* Fix warning in "complete shipment" dialog

- Broken due to recent API change / refactor

* Request item detail for sub-table

* Fix "ship items" button
2024-10-18 10:25:55 +11:00
Oliver
48dd3d37c4
Bug fix: Manually create serialized stock (#8306)
* Bug fix: Manually create serialized stock

- fixes bug which extraced location as a string, rather than the model instance

* Fix for StockList.create
2024-10-17 19:45:07 +11:00
Oliver
9e0a4c6a7e
Improve API query (#8302) 2024-10-16 20:51:09 +11:00
Oliver
59fa3bb4ff
Order table variants (#8295)
* BuildOrderTable: Show variants

- Allow filtering of build orders by part variant

* Add "include_variants" filter for SalesOrder table

- A bit tricker!

* Add "include_variants" filter to PartPurchaseOrdersTable

* Enable filtering ReturnOrder by "part" attribute

* Add similiar functionality for SalesOrderAllocation

* Add similar filter for BuildAllocation table

* Add migration file
2024-10-16 20:19:11 +11:00
Oliver
181e1dd9cc
Clear allocations when manually returning an item into stock from a customer (#8298) 2024-10-16 17:13:26 +11:00
Matthias Mair
61ca68090a
bump backend deps (#8290) 2024-10-16 07:03:59 +11:00
Oliver
b1d9a23928
[CUI] Fix rendering issues for barcodes (#8286)
- Prevent barcode data from being "escaped"
- Run through bleach to brevent malicious data injection
2024-10-15 14:50:29 +11:00
Oliver
14d92b8727
Fix bug in merge_stock_items (#8284)
- self() -> self
2024-10-15 14:20:14 +11:00
Oliver
8aade768c3
[PUI] subscribe (#8272)
* Add "starred" icon to part category table

* Edit "starred" status for PartCategory in PUI

* Edit "starred" state of part in PUI

* Playground fix
2024-10-12 11:55:23 +11:00
Oliver
7443d21854
[Refactor] Serial generation (#8246)
* Refactor "update_serial_number" method

* Refactor serial number validation

- Query is much more efficient now
- Does not have to check each serial number individually
- Makes use of existing Part class method

* Refactor creation of multiple stock items

* Fix for singular item creation

* Refactor serializeStock method:

- Push "rebuild tree" to background worker
- Use bulk_create actions

* Refactor createion of serialized build outputs

* Prevent 1+N DB hits

* Cleanup

* Cleanup

* Reinstate serial number checks

* Add limit for serial number extraction

* Fix cache config

* Revert cache settings

* Fix for unit tests

* Playwright tests

* Bug fix

* Force False cookie mode in testing

* Revert aria-label for PanelGroup items

- No longer works as expected with playwright locators

* Fix playwright vtest

* Further updates

* Playwright test adjustments

* Remove duplicate locator
2024-10-12 10:08:57 +11:00
Oliver
f77c8a5b5b
[PUI] Stock Detail (#8274)
* Add "in_stock" attribute to StockItem API

* Add "unavailable" badge to StockDetail page

* Hide stock actions menu for "unavailable" stock

* Fix renderer for StockItemTable

* refactor stock table display

* Add 'date' type details field

* Disable "expiry" information on StockDetailPage

* Icon fix

* Bump API version
2024-10-11 23:39:07 +11:00
Oliver
33eba14d3f
[PUI] Sales order shipments (#8250)
* Refactor AttachmentPanel into common component

* Remove unused imports

* Add very basic implementation for SalesOrderShipmentDetail page

* Refactor NotesPanel into common component

* Fetch customer data

* Add some placeholder actions

* Updates for shipment detail page

* Adjust SalesOrderShipment API

* Add badges

* Implement API filter for SalesOrderAllocation

* Display allocation table on shipment page

* Add placeholder action to edit allocations

* Improvements for SalesOrderAllocationTable

* Improve API db fetch efficiency

* Edit / delete pending allocations

* Fix for legacy CUI tables

* API tweaks

* Revert custom attachment code for SalesOrderShipment

* Implement "complete shipment" form

* Allocate stock item(s) to sales order

* Fixes for TableField rendering

* Reset sourceLocation when form opens

* Updated playwrigh tests

* Tweak branch (will be reverted)

* Revert github workflow
2024-10-10 22:43:22 +11:00
dependabot[bot]
a3f045e12c
Bump django from 4.2.15 to 4.2.16 in /src/backend (#8257)
* Bump django from 4.2.15 to 4.2.16 in /src/backend

Bumps [django](https://github.com/django/django) from 4.2.15 to 4.2.16.
- [Commits](https://github.com/django/django/compare/4.2.15...4.2.16)

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

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: Oliver <oliver.henry.walters@gmail.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
2024-10-10 21:00:10 +11:00
Oliver
914f59c4cc
[Breaking] Samesite Cookie Fix (#8269)
* Adjust samesite cookie behaviour:

- In DEBUG mode, turn off entirely
- Allow False value (note: *not* a string)
- Force insecure cookie in DEBUG mode

* Change default value in config file template

* Update docs

* Adjust COOKIE_SECURE based on SAMESITE setting
2024-10-10 20:18:14 +11:00
Oliver
8e34fddfaa
Samesite cookie fix (#8262)
- Closes https://github.com/inventree/InvenTree/issues/8254
2024-10-09 23:10:01 +11:00
Oliver
dde6aab8b4
Translation fixes (#8263)
* Translation fixes

- Simplifies translations strings
- Removes some similar duplicate strings
- Reduces passing of tokens into translation

* Adds script for detecting close matches in translation source strings

* Updates for custom script

* Detect duplicate strings (ignoring case)

* Fix some duplicate backend strings

* Fix duplicate strings in frontend

* Fix more duplicate strings

* Run check_source_strings in CI

* Fixes for unit tests

* Fix another broken string

* Revert some changes

* Fix f-string

* Fix old migration files

* Reduce front-end duplication

* Further updates

* Revert change

* Updates
2024-10-09 22:32:34 +11:00
github-actions[bot]
13ef30768f
New Crowdin translations by GitHub Action (#8242)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-10-09 05:08:48 +00:00
Oliver
c1b551d2e0
Allow orders to be completed without any "lines" (#8258)
* Allow orders to be completed without any "lines"

Note: There may be "extra lines" for these orders!

* Fix for unit test
2024-10-09 15:46:41 +11:00
Volker
560f57333c
fix part qr lable (#8255) 2024-10-08 21:03:22 +11:00
Oliver
198a39a33c
[Refactor] Sales Order Shipment (#8249)
* Refactor serial number allocation

* Refactor API query

Note: This should be further improved, not to automatically return *all* allocation data

* Push expensive operations off to background worker

* Bump API version
2024-10-08 08:00:32 +11:00
Oliver
798e25a9dc
[PUI] Plugin settings UI (#8228)
* Visual tweaks for admin pages

* Provide admin js file via API

* Backend fixes

* Tweak error detail drawer

* Refactor plugin detail panel

- Split out into separate files
- Use <Accordion />
- Display custom configuration (if available)

* Refactoring

* Add custom configuration to sample UI plugin

* Bump API version

* Add separate API endpoint for admin integration details

* Refactor plugin drawer

* Null check

* Add playwright tests for custom admin integration

* Enable plugin panels in "settings" pages

* Fix for unit test

* Hide "Plugin Settings" for plugin without "settings" mixin

* Fixes for playwright tests

* Update playwright tests

* Improved error message
2024-10-07 22:25:56 +11:00
Oliver
36e3159c1a
Unit Test Fixes (#8245)
* Add @types/dompurify

* JS fix

* Update allowed tags
2024-10-07 20:17:31 +11:00
Oliver
846b17aa1d
Merge commit from fork
* Sanitize markdown when rendering notes fields

* Update helpers.py

* Update mixins.py

* format

* format

* Allow horizontal rule in markdown

* Display returned error mesage

* More instructive error msg

* Specify output_format to markdown.markdown

Ref: https://python-markdown.github.io/reference/markdown/serializers/

* Cleanup

* Adjust allowable markdown tags

* Add unit test for malicious markdown XSS

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2024-10-07 08:57:47 +11:00
Dean
a1024f1a67
Fix build item over-allocation checks (#8235) 2024-10-06 21:08:40 +11:00
Dean
69bc5808d2
Shipment Attachments (#8231)
Create shipment attachments on parent order.
2024-10-03 08:31:38 +10:00
Oliver
5759b60a48
Merge commit from fork
* Sanitize markdown when rendering notes fields

* Revert "Sanitize markdown when rendering notes fields"

This reverts commit 373ebfbef0ce25fa58cb4e635e99f35b5e4df07c.

* Mask error message when downloading image
2024-10-02 14:24:45 +10:00
Oliver
c23f2828f5
New event triggers (#8226)
- When splitting a stock item
- When moving a stock item
2024-10-01 23:12:47 +10:00
Dean
fe7bbc2436
Shipment Reports (#8194)
* Shipment Reports

* bump api version due to changed enums

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2024-10-01 10:30:52 +10:00
Matthias Mair
96a2517402
A bit more testing (#8053)
* add more admin testing

* fix assertations

* add test for importer admin

* Add tests for https://github.com/inventree/InvenTree/pull/7164

* add common/attachment test

* fix test

* add tests

* remove unused definition - the view is read only

* Revert "remove unused definition - the view is read only"

This reverts commit 4cad8d16f395c447acffc241d90757cdf72109c0.

* more tests in report

* Update tests.py

* make lookup dynamic

* make report assertation dynamic

* add migration test

* extend validation plugin tests

* disable flaky test

* Add test for barcode/uid transition

* test reverse migration

* cleanup new test

* remove empty action

* split and refactor API tests

* refactor test

* Add test for error conditions

* fix double entry

* more migration tests

* also test no history

* fix assertation

* add another migration test

* fix typo

* fix manufacturer filter

* test more filters

* even more filter tests

* move top level test to right place

* add todos for tests that could be more expressive

* add test for checking duplicate serials

* ignore cautious catches
2024-10-01 08:27:57 +10:00
Matthias Mair
af6f179f7e
bump pre-commit refs (#8219) 2024-10-01 07:36:29 +10:00
Oliver
e9640f4f15
Plugin helper function (#8220)
* Add helper function for constructing URL to static file

* Fix PluginListTable

- Allow uninstallation of plugin
- Allow deletion of plugin config

* Move helper method to InvenTreePlugin class

* Bump API version info
2024-09-30 23:39:38 +10:00
Oliver
a71754b086
Add exception handling for default template creatoin (#8209) 2024-09-30 09:40:34 +10:00
Oliver
33499d61bd
Exception handling for BulkDeleteMixin (#8205)
* Exception handling for BulkDeleteMixin

* Fix unit test
2024-09-29 15:37:18 +10:00