Commit Graph

15449 Commits

Author SHA1 Message Date
Oliver
39ba25c5ed
Render API docs (#6463)
* Render API docs

* Cleanup broken links

* Re-enable strict mode

* Change json to yaml

* Update docs/docs/api/schema.md

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

* Update docs/docs/api/schema.md

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

* Use neoteroi-mkdocs instead

- seems to render more reliably

* Fix SERVERS section for SPECTACTULAR_SETTINGS

* Script for splitting schema into smaller sections

* Generate an index file for the schema pages

* Move schema.md up one directory

* Fix formatting

* Remove tracked file

* Add hook for rebuilding API schema as part of RTD build

* Extract schema as RTD build step

* install invoke

* export env vars

* remove argparse

* Fix order of operations

* Compress env vars

* Remove custom env vars

- Now configured as part of RTD project

* Migrate db

* Revert "remove argparse"

This reverts commit 4665805340.

* Post-process generated schema file

* Fix file formatting

* Add note about schema repo

* no message

* Reduce schema overhead

* Ignore generated files

* Delete generated file

* Update .gitignore

* Add extra split for machine integration

* Remove schema files

- These will be auto-generated too

* Generate individual schema .md files

* Re-add .md files

- Need git commit log to work

* Update .gitignore

* Fix for CI test

* patch machine.api

* Revert previous change

* Formatting fix

* Adjust export step

* Bump API version

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2024-03-02 11:28:37 +11:00
Oliver
d39ab9c902
Mount db to volume (#6616)
- Do not bind externally
2024-03-02 10:49:20 +11:00
Oliver
dc03b33c35
Plugin table fix (#6613)
* Fix for plugin_table

- Catch potential undefined error
- Reported via sentry.io

* style fix

* further style fixes
2024-03-01 23:36:01 +00:00
Oliver
69871699c0
Details updates (#6605)
* Fix onClick behaviour for details image

* Moving items

- These are not "tables" per-se

* Refactoring for DetailsTable

* Skip hidden fields

* Cleanup table column widths

* Update part details

* Fix icons

* Add image back to part details

- Also fix onClick events

* Update stockitem details page

* Implement details page for build order

* Implement CompanyDetails page

* Implemented salesorder details

* Update SalesOrder detalis

* ReturnOrder detail

* PurchaseOrder detail page

* Cleanup build details page

* Stock location detail

* Part Category detail

* Bump API version

* Bug fixes

* Use image, not thumbnail

* Fix field copy

* Cleanup imgae hover

* Improve PartDetail

- Add more data
- Add icons

* Refactoring

- Move Details out of "tables" directory

* Remove old file

* Revert "Remove old file"

This reverts commit 6fd131f2a5.

* Fix files

* Fix unused import
2024-03-01 06:13:08 +00:00
Oliver
c8d6f2246b
Fix postgresql container (#6610)
- Linked volume caused permission issues
2024-03-01 05:53:42 +00:00
Oliver
eb3d51f8a7
Adjust pkgr.yml (#6608)
* Adjust pkgr.yml

- Ref: https://github.com/inventree/InvenTree/issues/6154#issuecomment-1970536725
- Ref: https://doc.packager.io/documentation/customizing-the-build/#dependencies

* add in nginx config again

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2024-03-01 12:49:06 +11:00
Oliver
6962b61fff
Fix docker tags (#6606)
- Revert to previous approach
2024-03-01 07:01:46 +11:00
Oliver
37c1fe1ccb
BOM / Build Updates (#6604)
* Fix for build line table

- Prefill source location correctly

* Refactor API filtering for BomList

- Make use of RestFilter class

* Add "external stock" field to BomItem serializer

* Simplify custom filtering

* Add "structural" column to part table

* Update BOM tables:

- Display indication of "external stock"

* Annotate "external_stock" to part serializer

- Update PartTable [PUI]

* Annotate BuildLine serializer too

* BuildLine endpoint - filter available stock based on source build order

- If build order is specified, and has a source location, use that to filter available stock!

* Add message above build line table

* Update BuildLineTable

* Bump API version
2024-02-29 16:16:28 +11:00
Oliver
05e67d310a
Details image tweaks (#6603)
* Changes for PartThumbTable:

- Limit use of custom styling
- Better display of images

* Fix background color

* Use <StylishText> for titles

* Cleanup details grid

- Use Mantine components
- Simplify structure

* Fix TableThumbProps
2024-02-29 11:18:08 +11:00
Oliver
cbd2794a7e
New Crowdin updates (#6600)
* 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

* Fix ru newlines

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-29 09:21:05 +11:00
Oliver
bf97804a0b
Tweaks for SITE_URL setup (#6602) 2024-02-28 11:54:07 +00:00
Oliver
b192c44b61
Tweak for devcontainer docker compose (#6601)
- Do not use named volume
- Hardcode db path
2024-02-28 19:03:19 +11:00
Oliver
820d7c6a15
[PUI] Part parameter table (#6599)
* Refactor for PartTable

* Skeleton for ParametricPartTable

* Implement parametric part table

* Table updates
2024-02-28 06:43:36 +00:00
Oliver
a2a7b60d41
[PUI] Adds NewPart form (#6598) 2024-02-28 05:56:19 +00:00
Oliver
38d013ffe2
[PUI] Stock item forms (#6597)
* Implement "new stock item" button

* Fix adjustFilters for StockForm

* Fix imports
2024-02-28 05:43:18 +00:00
Oliver
2e81a304d1
Devcontainer postgresql (#6590)
* Working on devcontainer with postgresql

* Fix for docker-compose.yml

* Update postCreateCommand

* Tweak docker compose file

* Fix Dockerfile

- Do not use uv (breaks process)

* Update postCreateCommand.sh

- Skip database backup

* Tweak file

* Further improvements

- Remove 'devcontainer' Dockerfile target
- Fix postCreateCommand

* Further cleanup

* Reduce SQL errors

- Use filter().exists() rather than get()

* Set default SITE_URL

* Docs updates

* Fix hard-coded django version

* Update faq.md

* Typo fix: PluginObject -> PluginConfig

* Docs: strict mode

* docs: fix link

* docs: fix typo

* Fix error message

* Revert change to config_template default
2024-02-28 15:04:14 +11:00
Oliver
8f8b46e50d
Translation fixes (#6595)
- Remove extraneous \n chars
2024-02-28 01:44:05 +00:00
Matthias Mair
1199291835
Refactor label/report template copying (#6582)
* [BUG] Inventree fiddles with files directly rather than using Django Storage api
Fixes #2585

* PEP fix

* clean diff

* move template discovery into central location

* more moving file operations

* fix paths

* and another path fixing

* more fixes

* fix typing

* switch config back to local

* revert locale stats

* add s3 support

* storages

* more adaptions

* use s3 switch to set storage backend

* fix reqs

* cleanup default_storage

* init in storage_backend

* move to storage classes everywhere

* fix call

* remove more S3 references

* move storage init

* fix startup error

* alsways use url

* ignore FileExistsError

* move s3 required url in

* remove S3 for now

* use Djangos defaults

* fix old import

* remove default_storage calls

* make labels/reports more similar

* expand functions out

* refactor to use refs where possible

* refactor copy section to be similar

* unify db lookup

* move shared code to generic section

* move ready out

* docstrings

* move even more functions out

* move references inline of the classes

* clean up refs

* fix init

* fix ensure dir

* remove unneeded tries

* cleanup diff

* more cleanup

* fix tests

* use SUBDIR
2024-02-28 09:25:01 +11:00
Oliver
f6123cc261
[WIP] docker / Caddy (#6551)
* remove docker-sqlite file

- Do not want to encourage use of sqlite

* Add Caddyfile

* Add default site URL to .env

- Matches Caddyfile

* Cleanup / simplify .env file

* Remove dev nginx conf file

* Further cleanup of .env file

* Update docker-compose.yml

- Use caddy image instead of nginx as proxy

* Set max body size

* gunicorn: enable external logging

* Update file structure

* Cleanup docker-compose file

* Update docker/docker-compose.yml

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

* Update docker/Caddyfile

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

* Fix for postgresql packages

- Need postgresql13-client to be installed, it contains pg_dump
- Without this, backup / restore *does not work*

* Create static_i18n dir if it does not exist

* Reduce output from collectstatic

* Revert gunicorn logging

- Want to see the logs in docker

* Fix trailing slash

Ref: https://github.com/inventree/InvenTree/pull/6551#issuecomment-1962423765

* tasks.py - pass 'nouv' option through

* Update package requirements:

- Allow installation of rapidfuzz without building

* Install uv as part of docker image

* Add environment variable to control downstream URL

* Do not use uv package manager by default

- Currently does not work "correctly" - ignores installed packages
- Requires further work to run reliably

* Fix docker-compose file

- Do not build locally

* Cleanup gunicorn file

- Remove unused lien

* Cleanup docker-compose.yml

- Simpler volume management

* Update Caddyfile

Add newline

* Update requirements.txt

Add newline

* Update tasks.py

Add missing blank line

* Simplify Caddyfile

* Adds option for customizing web port

* cleanup docker-compose.yml

- Better mapping of caddy data
- Cleaner volume setup

* Add django version template

- Ensure all docs links point to the current django version we are using

* docs: cleanup intro.md

* Cleanup serving_files.md

* Cleanup config.md

* docker install docs updates

* Enable code block copying

* Fix include file

* Fix link

* Update docker install docs

* Update docker.md

* Add info about demo dataset

* Tweak heading

* Update docs link checks

* Fix workflow

* Another fix

* More ignore pattearns

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2024-02-28 01:06:19 +11:00
Oliver
8a128a2bdd
New Crowdin updates (#6567)
* updated translation base

* 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

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-27 07:10:57 +00:00
Oliver
bbace2b1c9
Silence duplicate template warnings (#6586) 2024-02-27 06:41:46 +00:00
Oliver
0c6334b3b4
Fix SITE_URL validator (#6585)
- Closes https://github.com/inventree/InvenTree/issues/6574
2024-02-27 16:46:48 +11:00
Oliver
405523881c
Temperature units (#6584)
* Update unit conversion

- Set autoconvert_offset_to_baseunit attribute
- Add aliases for common temperature units
- Raise error if invalid target unit is provided

* Updated unit tests

- Checks for temperature conversion
- Checks for invalid units
2024-02-27 05:09:07 +00:00
Oliver
bb105d8c08
Tree fix (#6583)
* PartCategoryTree - add "subcategories" field

* Fix rendering of PartCategoryTree

* Implement similar fixes for StockLocationTree

* Bump API version

* Breadcrumb list tweak

- Limit to 7 items

* Fix bug for stock tree serializer

* Add unit tests
2024-02-27 03:00:32 +00:00
Oliver
de23023277
Tree fix (#6581)
* PartCategoryTree - add "subcategories" field

* Fix rendering of PartCategoryTree

* Implement similar fixes for StockLocationTree

* Bump API version
2024-02-27 01:00:11 +00:00
Oliver
8db769968f
Allow currency symbol to be omitted from render_currency (#6580)
- Closes https://github.com/inventree/InvenTree/issues/6578
2024-02-26 23:16:54 +00:00
Matthias Mair
ea63a03fe4
Refactor docker CI for speed increases (#6562)
* push to ghcr (#168)

* Update docker.yaml

* Update docker.yaml

* Update docker.yaml

* use matrix to build for the plattforms (faster amd pub)

* try Buildjet

* switch to pyhton 3.9

* Update docker.yaml

* path python manually?

* bump python to 3.11

* Update Dockerfile

* step down vm

* cleanup workflow

* install docker on mac

* and docker compose too

* switch back to linux

* Docker tests (#175)

* push to ghcr (#168)

* Update docker.yaml

* Update docker.yaml

* Update docker.yaml

* use matrix to build for the plattforms (faster amd pub)

* try Buildjet

* switch to pyhton 3.9

* Update docker.yaml

* path python manually?

* bump python to 3.11

* Update Dockerfile

* step down vm

* cleanup workflow

* install docker on mac

* and docker compose too

* switch back to linux

* switch to uv

* fix uv install

* reintroduce checks

* cleanup diff
2024-02-27 09:50:44 +11:00
Matthias Mair
75c24fb8f4
Add config option to fully disable installing plugins (#6535)
* [FR] Add config option to fully disable installing plugins
Fixes #6531

* also restrict uninstalling

* Added test

* diff cleanup

* extend api to show if install was disabled

* PUI disable install buttons

* CUI disable install button if not available

* add config option

* Rephrase
2024-02-26 11:44:31 +00:00
Matthias Mair
85225538e6
Create test files in seperate folder & cleanup before image build (#6571)
* move ignore

* create testfiles in seperate folder

* add cleanup step to docker build

* use pathlib for paths
2024-02-26 11:23:49 +11:00
Bobbe
f441f672d6
Switch tests, docs, database settings from psycopg2 to psycopg (#6573)
* Fix isolation_level again, using the recommended method

* Use psycopg instead of psycopg2 in tests, docs
2024-02-26 10:58:32 +11:00
Oliver
18dcc60efd
Update README.md (#6572)
Update sponsors
2024-02-26 09:50:42 +11:00
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