Commit Graph

14742 Commits

Author SHA1 Message Date
Bobbe
59f17a9885
Bump django_money version back to 3.2.0, Fix #5825 (#5828)
* Bump django_money version back to 3.2.0

* Test building docker image

* Revert "Test building docker image"

This reverts commit b8e9d4f4c1.
2023-11-01 10:05:47 +11:00
Oliver
e18b6d38ef
React updates (#5826)
* Add more panels to StockItem page

* Add some placeholder actions for StockItem page

* edit stock item

* Add info hover card to stocktable

* update extra info for part table

* Add extra columns to PurchaseOrder table

* Fix unused import
2023-11-01 07:32:40 +11:00
Oliver
2908ad0721
Recursive delete fix fix (#5819)
* Enable mysql checks as part of PR

* Add debug for CI

* Add delete_nodes method

- Ensure that the "parent" field is set to None before delete
- This means that we do not violate any ForeignKey constraints due to undefined order of operations
2023-10-31 22:58:43 +11:00
Bobbe
4913acda79
Update django money / py-moneyed dependencies (#5778)
* Replace moneyed format_money function

* Update django-money to 3.3.0 and py-moneyed to 3.0

* Add CurrencyField migrations

* Fix checking if decimal_places is set

* Add currency formatting test

* Test fixing deepsource test patterns

* Revert "Test fixing deepsource test patterns"

This reverts commit 398ef93cd6.

* FIx requirements.txt formatting

* Revert "FIx requirements.txt formatting"

This reverts commit bb554b0758.
2023-10-31 22:19:55 +11:00
Oliver
ebaa7d64a8
Skip plugin registry reload if performing django functions (#5823)
* Skip plugin registry reload if performing django functions

* Revert changes to pre-commit
2023-10-31 15:47:59 +11:00
Matthias Mair
782f36cd48
[PUI] Added AboutInventreeModal (#5813)
* updated typing to allow either link or action

* fixed typing

* made it possible to use an action instead of a link

* added ServerInfo Modal skeleton

* fixed anchor

* added content to ServerInfo

* Factored database lookup out

* Extended status API to CUI level

* extended ServerInfo to CUI level

* Made modal larger

* fixed default settings

* Refactored urls into seperate functions

* Refactored python version into seperate function

* Added endpoint and modal for PUI version modal

* switched to indirect imports to reduce imports

* Added copy button

* Added full copy button

* added default

* cleaned unused vars

* cleaned unused  vars

* Refactored auth check for InfoView

* implemented suggested changes

* fixed check logic
2023-10-31 10:02:28 +11:00
Oliver
43fac17796
Part table extra options (#5821)
* Render stock information on hover in part table

* Fix minimum_stock serializer field
2023-10-31 10:01:13 +11:00
Oliver
a83bc32fc7
[React] Stylish form titles (#5817)
* Use <StylishText> for form title

- Also removes useModalState
- This was clunky

* Remove unused improt
2023-10-31 00:05:24 +11:00
Oliver
3f7d05339b
[React] BOM table (#5816)
* Add BuildOrderTable to part page

* Add UsedInTable

* Display SalesOrderTable on PartDetail page

* Fix horizontal overflow for panel group

* First pass at BomTable

* Adds <TableHoverCard> component

- Allows us to display more information in a table cell, without clutter

* Fix for row actions

- Prevent opening row actions menu from "clicking" the row
- Prevent selection of row action from "clicking" the row

* Further work on BOM table

- Column rendering
- Placeholder actions

* Prevent navigation to a panel group page and selection of invalid panel

* Fix unused references
2023-10-31 00:02:42 +11:00
Oliver
98d7c49ea5
Update .deepsource.toml (#5814)
Additional deepsource fix
2023-10-30 13:18:48 +11:00
Oliver
8c14614bb5
Update .deepsource.toml (#5812)
Fix test patterns for deepsource

Ref: https://github.com/inventree/InvenTree/pull/5778#issuecomment-1781903275
2023-10-30 12:41:17 +11:00
Matthias Mair
8aad3eeefa
[PUI] Added Server Info Modal (#5810)
* updated typing to allow either link or action

* fixed typing

* made it possible to use an action instead of a link

* added ServerInfo Modal skeleton

* fixed anchor

* added content to ServerInfo

* Factored database lookup out

* Extended status API to CUI level

* extended ServerInfo to CUI level

* Made modal larger

* fixed default settings
2023-10-30 09:56:07 +11:00
Matthias Mair
7ff3f99dc9
Add deepsource code coverage (#5717)
* added deepsource coverage settings

* Ignore missing coverage

* trigger full CI run

* only run when upstream, master and push
2023-10-30 06:58:48 +11:00
Matthias Mair
5d6d847328
made default radius for UI smaller (#5809) 2023-10-30 06:58:06 +11:00
Oliver
fd0a57c4a1
Improve deletion behaviour for InvenTreeTree model (#5806)
* Improve deletion behaviour for InvenTreeTree model

- Remove recursive call to function
- Handle database operations as bulk queries
- Ensure child nodes have their pathstring updated correctly
- Remove old @receiver hook
- Refactor StockLocation.delete method
- Refactor PartCategory.delete method
- Atomic transactions potentially problematic here

* Add docstring

* Fix method name

* Use bulk-update instead of recursive save when pathstring changes

* Improvements for tree delete method

- Handle case where item has already been deleted

* Raise exception rather than simply logging

* Update unit tests

* Improvements to unrelated unit test

* Fix urls.md

* Fix typo
2023-10-30 06:57:40 +11:00
Oliver
a1f9260da6
Build part change fix (#5808)
* Add DiffMixin class

- Allows us to compute "diffs" against items stored in the database, when they are being updated

* Prevent build order part from being changed after creation

* Remove "part" field from buildorder edit form

* Add unit test
2023-10-29 23:13:38 +11:00
Michael
4cd4a84bac
Added context variables for address (#5807)
* Corrected report mixin example

* Remove unused file

* Added context variables for company and address

* Repair link in file

* Repair link in file

* Repair link in file

* Removed blank
2023-10-29 22:07:21 +11:00
Joshua Miller
3c5e2a3541
Added Views, blocks, and templates documentation (#5805) 2023-10-29 12:11:10 +11:00
Oliver
f29a675824
[React] Tree navigation (#5800)
* Adds placehold "PartCategoryTree"

- Global navigation (within the "Part" context) for part categories
- Replaces multiple tree views from legacy UI

* FIx for ApiImage component

- Do not continuously request if the user is unauthorized

* Add StockLocation tree

* Add initial data to nav tree panels

* Display data

* Render tree view

* Fix unused variables
2023-10-28 00:35:52 +11:00
Michael
70578500ca
Corrected example in report mixin (#5801)
* Corrected report mixin example

* Remove unused file
2023-10-27 23:08:30 +11:00
Matthias Mair
c47fa01965
[PUI] Raise translation/language support to CUI level (#5749)
* Added more languages

* Added translation stumps for PUI

* Exclude PUI translations from deepsource analysis

* Added comments to deepsource exlusions

* Modified language selection to use language names

* Refactored language mappings to be more efficient
following advice of @wolflu05

* Removed pseudo language from selection

* Translation cleanup

* Switched t/Trans useage

* switched back due to rendering limitations

* Revert "Merge branch 'master' of https://github.com/inventree/InvenTree into matmair/issue5729"

This reverts commit 9b6e8fff88, reversing
changes made to 481cd70aca.

* Revert "Revert "Merge branch 'master' of https://github.com/inventree/InvenTree into matmair/issue5729""

This reverts commit 143a531c1e.

* add translations back in

* add translations back in

* update translation postitions

* move language initialisation after loading
this means only en-gb for now

* update positions
2023-10-27 20:25:02 +11:00
Oliver
0acfaced83
React interface updates (#5798)
* Fix for <ActionDropdown> component

- Ensure component key is set properly

* Update <PageDetail> component

- Consolidate and simplify

* Update proxy settings for react development

* Fixes for StatusRenderer component

- Cannot use state hook inside function

* Add PurchaseOrderDetail page

* Tweak ApiImage component

* Add "ReceivedStock" table to PurchaseOrder detail page

* Add SalesOrderDetail page

* Add ReturnOrderDetail page

* Cleanup unused variables

* Remove import for unused icon
2023-10-27 14:39:17 +11:00
Oliver
22e9b14743
Update sponsors.yml (#5794)
Fix target branch
2023-10-27 14:06:57 +11:00
Oliver
6cba00c1d2
New Crowdin updates (#5769)
* 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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 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 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 messages.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 messages.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 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 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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.po from Crowdin

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-27 09:10:35 +11:00
Matthias Mair
20d1fa847e
Various style fixes (#5797)
* removed unused imports

* use f-string where applicable

* string format changes
2023-10-27 09:06:48 +11:00
Oliver
82b376de5b
Improve WSL detection for vite.config.ts (#5796) 2023-10-26 22:10:02 +11:00
Matthias Mair
53c16510a1
[PUI] Render status labels (#5759)
* added deepsource coverage settings

* Ignore missing coverage

* trigger full CI run

* typo

* Added general status lookup endpoint

* Bumped API version

* cleaned up branch

* Fixed PlaygroundArea accordion behaviour

* Added dummy area for status labels

* Added StatusRenderer skeleton

* Fetch data from server

* Made server api state session persistant

* cleanup

* Added StatusLabel lookups based on ModelType

* Made use of translated status fields

* Added new ModelTypes

* Used new StatusRenderer

* Simplified renderer

* style fixes

* revert style change

* Squashed commit of the following:

commit 5e8ea099068475fd257d8c172348dc6f3edf9bcf
Author: Matthias Mair <code@mjmair.com>
Date:   Tue Oct 24 09:22:38 2023 +0200

    Update ui_plattform.spec.ts

commit 49da3312beff7fd6837ea741e621df221c445d19
Author: Matthias Mair <code@mjmair.com>
Date:   Tue Oct 24 07:56:25 2023 +0200

    more logging

commit 5337be4c3990051b805a6fce2e79ca4030b4afe5
Author: Matthias Mair <code@mjmair.com>
Date:   Tue Oct 24 07:56:11 2023 +0200

    added filter method for undefined settings that overwrite defaults

commit 5df8a0b3e77cd5dcf04c39ad7638ac845df75e4c
Author: Matthias Mair <code@mjmair.com>
Date:   Tue Oct 24 03:05:06 2023 +0200

    you do not need to string a string

commit 0650d3b3a0132889c2a76de38db38224e974d205
Author: Matthias Mair <code@mjmair.com>
Date:   Tue Oct 24 03:04:34 2023 +0200

    fix things that were borken for no good reason

commit a40dbfd1364cf01465037350184f59d2a2a8afab
Author: Matthias Mair <code@mjmair.com>
Date:   Tue Oct 24 02:39:34 2023 +0200

    reduce unneeded blocking timeouts

commit bf9046a5361ae919e70662e717d6156434b6fe43
Author: Matthias Mair <code@mjmair.com>
Date:   Tue Oct 24 02:34:10 2023 +0200

    catch server fetching errors

commit aa01e67e8c8e789fdf755ac4481e730fe5ea4183
Author: Matthias Mair <code@mjmair.com>
Date:   Tue Oct 24 02:33:29 2023 +0200

    move init as things are now plugged together different

commit 290c33bd3125d50779497d6fc5981d5813b58f5d
Author: Matthias Mair <code@mjmair.com>
Date:   Tue Oct 24 01:49:32 2023 +0200

    do not log a failed automatic login try - why would you?
2023-10-26 21:49:38 +11:00
Oliver
2ff2c0801a
Check minimum python version before launching (#5795)
* Check minimum python version before launching

* Add link to docs
2023-10-26 21:45:23 +11:00
Oliver
b5bd45d891
Update sponsors.yml (#5793)
Set organisation flag (required)
2023-10-26 18:17:26 +11:00
Oliver
a1cb954cb0
Readme sponsors (#5789)
* Add sponsors action

- Automatically show list of project sponsors
- Ref: https://github.com/JamesIves/github-sponsors-readme-action

* Update README.md

* Pin workflow action versions
2023-10-26 17:35:18 +11:00
Matthias Mair
02d55b9c87
Squashed commit of the following: (#5785)
commit 5e8ea099068475fd257d8c172348dc6f3edf9bcf
Author: Matthias Mair <code@mjmair.com>
Date:   Tue Oct 24 09:22:38 2023 +0200

    Update ui_plattform.spec.ts

commit 49da3312beff7fd6837ea741e621df221c445d19
Author: Matthias Mair <code@mjmair.com>
Date:   Tue Oct 24 07:56:25 2023 +0200

    more logging

commit 5337be4c3990051b805a6fce2e79ca4030b4afe5
Author: Matthias Mair <code@mjmair.com>
Date:   Tue Oct 24 07:56:11 2023 +0200

    added filter method for undefined settings that overwrite defaults

commit 5df8a0b3e77cd5dcf04c39ad7638ac845df75e4c
Author: Matthias Mair <code@mjmair.com>
Date:   Tue Oct 24 03:05:06 2023 +0200

    you do not need to string a string

commit 0650d3b3a0132889c2a76de38db38224e974d205
Author: Matthias Mair <code@mjmair.com>
Date:   Tue Oct 24 03:04:34 2023 +0200

    fix things that were borken for no good reason

commit a40dbfd1364cf01465037350184f59d2a2a8afab
Author: Matthias Mair <code@mjmair.com>
Date:   Tue Oct 24 02:39:34 2023 +0200

    reduce unneeded blocking timeouts

commit bf9046a5361ae919e70662e717d6156434b6fe43
Author: Matthias Mair <code@mjmair.com>
Date:   Tue Oct 24 02:34:10 2023 +0200

    catch server fetching errors

commit aa01e67e8c8e789fdf755ac4481e730fe5ea4183
Author: Matthias Mair <code@mjmair.com>
Date:   Tue Oct 24 02:33:29 2023 +0200

    move init as things are now plugged together different

commit 290c33bd3125d50779497d6fc5981d5813b58f5d
Author: Matthias Mair <code@mjmair.com>
Date:   Tue Oct 24 01:49:32 2023 +0200

    do not log a failed automatic login try - why would you?
2023-10-26 07:55:52 +11:00
Oliver
e13b57669c
Barcode app docs (#5788)
* Update settings page

* Update barcode action documentation

* Update app privacy information
2023-10-25 23:46:26 +11:00
Oliver
f280e0aeaf
Update sales_order.js (#5784)
Typo fix
2023-10-25 12:24:30 +11:00
Oliver
dfc4fa7584
Fixes for table rendering (#5782)
- Handle case where related object does not exist in the dataset
2023-10-25 11:45:00 +11:00
Matthias Mair
8308f36923
bump action versions (#5776) 2023-10-25 09:18:53 +11:00
Oliver
679b49b4f7
Frontend server settings (#5765)
* Update ApiToken model

- Add metadata
- Remove unique_together requirement
- Add last_seen field

* Update admin page for token

* Store metadata against token on creation

* Track last-seen date

* Allow match against existing valid token

- If token is expired or revoked, create a new one
- Prevents duplication of tokens

* Update unit tests

* Fix default server

* Improve functionality for extracting frontend settings

* Update default server list

* Use f-strings

* Revert logger name

* Remove mark_safe warning
2023-10-23 22:33:16 +11:00
Oliver
39c499622d
Part responsible owner (#5774)
* Add "responsible_owner" field to part model

- Will replace "responsible" field

* Data migration

- Adds 'responsible_owner' value for parts which have 'responsible' set
- Selects correct content type
- Performs reverse migratoin

* Update part serializer

- Point to the new field
- Rename to preserve compatibility
- OPTIONS metadata will take care of the rest

* Remove old 'responsible' field

* Bump API version

* Fix typo

* Fix serializer field
2023-10-23 21:35:51 +11:00
Oliver
2dfe2d97bc
plugin hash - reduce error outputs (#5772)
* plugin hash - reduce error outputs

- If database is migrating, or not ready, don't log exception
- Ref: https://github.com/inventree/inventree-app/actions/runs/6604140572/job/17937959893

* Improve imports

* Further import improvements

* Typo fix
2023-10-23 10:01:28 +11:00
Oliver
d03927dea4
Fix imports in inventree_extras.py (#5770)
- Can cause a circular import
- Ref: https://github.com/inventree/inventree-app/actions/runs/6603924590/job/17937528806
2023-10-23 00:31:02 +11:00
Oliver
4d79c9f985
Add admin filters for ApiToken (#5768) 2023-10-21 22:48:41 +11:00
Oliver
b335728e29
Fix admin site - Custom admin URL (#5766)
* Update config template file

* Add entry to docs

* Add INVENTREE_ADMIN_ENABLED to settings.py

* Add helper functions for improving admin links

* Refactor existing admin links

* remove debug statements

* Fix custom admin URL

* Expand documentation

* Fix URL

* Improve wording in config_template.yaml

* Extend admin_url tag

- Allow lookup without pk
- Handle case where pk not found
2023-10-21 22:12:14 +11:00
Oliver
388b722de1
Handle case where 'title' does not exist (#5767) 2023-10-21 21:35:51 +11:00
Oliver
f0f4a20f4e
More token tweaks (#5764)
* Update ApiToken model

- Add metadata
- Remove unique_together requirement
- Add last_seen field

* Update admin page for token

* Store metadata against token on creation

* Track last-seen date

* Allow match against existing valid token

- If token is expired or revoked, create a new one
- Prevents duplication of tokens

* Update unit tests
2023-10-21 15:10:11 +11:00
Oliver
3b6c941f65
Token tweaks (#5761)
* Ensure token name is trimmed

* Improve sanitizing of token name
2023-10-20 20:39:53 +11:00
Matthias Mair
47964d24c0
Fixed PlaygroundArea accordion behaviour (#5760) 2023-10-20 17:16:54 +11:00
Oliver
23ea746813
Api token updates (#5664)
* Create new APIToken model

- Has custom 'name' field
- Has custom expiry date

* Add data migration to port across any existing user tokens

* Adds 'revoked' field - tokens can be manually revoked

* Update API token - allow multiple tokens per user

* Custom token auth handler

- Correctly handles revoked tokens
- Correctly handles expired tokens

* Update AuthRequiredMiddleware

- Check for token active status

* Token API endpoint improvements

- Can return tokens with custom names
- Return more information on the token too

* Consolidate migrations

* When requesting a token, overwrite inactive token for authenticated user

- An authenticated user must receive a token
- Unauthenticated users cannot do this

* Fix

* Use token name for frontend

* Force token expiry, and generate default expiry date

* Force generation of a new token when requested

* Reduce data exposed on token API endpoint

* Display redacted token in admin site

* Log when new token is created for user

* Add default value for token

- Allows raw token to be viewed in the admin interface when created
- After created, no longer visible
- Also provides ability to generate token with static prefix

* Fixes for admin interface

- Prevent user and expiry from being edited after creation

* Implement unit tests for token functionality

* Fix content exclude for import/export

* Fix typo

* Further tweaks

- Prevent editing of "name" field after creation
- Add isoformat date suffix to token

* Longer token requires longer database field!

* Fix other API tokens

* Remove 'delete' method from token API endpoint

* Bump API version
2023-10-20 14:06:06 +11:00
Oliver
25138300ff
New Crowdin updates (#5758)
* 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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.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 messages.po from Crowdin

* Fix: New translations django.po from Crowdin

* Fix: New translations messages.po from Crowdin

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-20 12:48:42 +11:00
Oliver
e57b69be48
React UI improvements (#5756)
* Add CompanyDetail page

* Add "edit company" button (and associated form)

* Implement dropdown actions for company page

* Update actions for PartDetail

* Adds overlay while modal is loading

- Lets the user know that something is at least happening in the background

* Update panels

* Implement separate pages for different company types

- Mostly for better breadcrumbs

* Placeholder actions for build detail

* Add stock table to company page

* typescript linting

* Fix unused variables

* remove dodgy improt
2023-10-20 00:23:58 +11:00
Bobbe
ae063d2722
Add basic support for scanning vendor barcodes (#5509)
* Add support for scanning digikey and mouser barcodes

* added small fixes if no part is found

* made small style cleanups

* Separate out ecia 2d barcode parser, Add quantity, PO number to response

* Use model instead of name for mouser supplier, add auto detection magic

* Add lcsc barcode support

* Move barcode plugins to new suppliers subdirectory

* Add get_supplier_part helper, Refactor plugins in preparation for #3791

* Add __init__.py to suppliers directory

* Improve formatting

* Add barcode integration tests

* Add api-barcode-po-receive endpoint

* Refactor supplier_barcode.py helpers into BarcodeMixin

* Implement the api-barcode-po-receive endpoint for all suppliers

* Always include lineitem in api response

* Fix location in response, only include quantity and location if set

* Check if barcode has already been assigned, Fix tests

* FIx quantity and location not being in lineitem reponse

* Use part.get_default_location() instead of part.default_location

* Fix fomatting again

* Fix type annotations for python 3.8

* Add get_supplier_part helper, check for barcode_data being a str

* Fix naming clash

* Clarify return type for scan_receive_item

* Improve model access using first() in two places

* Refactor a bunch of checks

* Improve selection of line item, if multiple line items match the SKU

* Add new api version for this PR

* Fix error if no line item exists

* Add debug print to investigate why tests are failing

* Remove the test print again

* Fix pre formatted log messages

* Test removing all plugins

* Test only with digikey plugin

* Test with all plugins, but without mouser "model" setting

* Test again without tests

* Test with simple tests

* Test with simple receive test

* Test with even more receive tests

* Test second receive test

* Test third receive test

* Test 4th receive test with debug prints

* Try deleting the stock item and stock locations

* Disable the test again

* Add SupplierBarcodeMixin to minimize shared code between plugins

* Add TME supplier barcode plugin

* Remove the TME tests again

* If this works the tests are broken, if this doesn't work the tests are broken too

* Add TME tests again

* Add back all tests again

* Fix TME purchase order number

* Fix TME qrcode regex

* Add documentation for this feature

* Fix TME qrcode regex

* Use Decimal instead of int for quantity

* Refactor get_supplier_parts, Add get_supplier method

* Improve docstrings

* Fix None type access

* FIx TME barcode detection, Improve supplier barcode handling

* Try to retrigger pipeline

* Refactor get_supplier_parts to not use lists

* Add DEFAULT_SUPPLIER_NAME to mouser plugin

* Add SUPPLIER_ID setting to other suppliers

* Fix supplier plugins not inheriting from settings mixin

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2023-10-19 23:28:21 +11:00
Oliver
2be5ec26f8
[React] Login improvements (#5752)
* Logout user if user query fails

* login / logout improvements

- Add timeout to request (otherwise hangs indefinitely)

* Improve "checking login" page

* Update login form

- Disable button if logging in
- Show loader

* Fixed unused vars
2023-10-19 13:42:12 +11:00