Commit Graph

15329 Commits

Author SHA1 Message Date
Oliver
7de87383b5
Update .env (#6700)
Fix comment - no need to change Caddyfile in most cases
2024-03-13 10:37:56 +00:00
Oliver
2fef34852c
Unit tests for HOST settings (#6698)
- CORS
- ALLOWED_HOSTS
2024-03-13 09:37:05 +00:00
Xander Luciano
128fa95f71
Fix undefined tabValue (#6694) 2024-03-13 08:05:53 +00:00
Oliver
891c4fef6a
ParametricPartTable Updates (#6692)
* Add parameter units to ParametricPartTable

* Fix conversion aliases
2024-03-13 16:02:40 +11:00
Oliver
b33314659b
Cleanup settings.py (#6691)
- Remove INTERNAL_IPS array
- Used previously for debug_toolbar integration
2024-03-13 03:44:37 +00:00
Oliver
2f852c8aa2
Caddy fix (#6690)
* Caddyfile updates

- Provide CORS headers for /static/ and /media/

* Adjust config_template

- Make more open by default
2024-03-13 03:27:26 +00:00
Oliver
6389493c33
Test key fix (#6685)
* Fix for generateTestKey

- Check for zero-length key

* Ensure test template name would generate valid key

* Add unit test

* Improve generateTestKey method

- Allow for non-latin chars

* Update generateTestKey

- Improve check for valid char
2024-03-13 12:36:06 +11:00
Oliver
6033e87359
Auth endpoint updates (#6683)
- Allow CORS requests to /auth/
- Do not redirect
2024-03-12 22:11:17 +00:00
Oliver
011f19cf61
Allowed host fix (#6682)
* Update ALLOWED_HOSTS

- Simplify backup logic
- Remove schema prefix

* Fix typo
2024-03-12 22:06:47 +00:00
Oliver
e764833f1f
settings.py - fix default value (#6681)
- Use None instead of empty dict
2024-03-12 21:53:19 +00:00
Oliver
c185a267da
Handle more caching exception pathways (#6678) 2024-03-12 03:53:02 +00:00
Oliver
60f3e849e7
New Crowdin updates (#6659)
* updated translation base

* 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 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

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-12 03:33:07 +00:00
Oliver
2926d7596b
Fix typecasting in settings.py (#6676)
- Properly cast dict values
- Fixes https://github.com/inventree/InvenTree/issues/6668
2024-03-12 03:15:26 +00:00
Oliver
f5a42172ac
Cache exception handling (#6675)
* Improve cache loading for setting

- Handle generic exception
- Do not cache if importing data

* More generic exception handling

* Handle more cache exceptions
2024-03-12 03:09:28 +00:00
Oliver
8719dd7e1e
Feet and inches (#6674)
* Conversion: Handle feet and inches

- Support ' for feet
- Support " for inches

* Add unit test

* Doc updates
2024-03-12 03:04:10 +00:00
Oliver
6920efb456
Set ACCOUNT_EMAIL_SUBJECT_PREFIX (#6673)
- Copy value from EMAIL_SUBJECT_PREFIX
- Used for django-allauth
- Ref: https://github.com/inventree/InvenTree/discussions/6672
2024-03-12 02:37:20 +00:00
Oliver
a613a7b9fc
Use whitenoise for static file handling (#6662)
* Update config_template.yaml file

* Adjust ALLOWED_HOSTS behaviour

- Only add wildcard * in DEBUG mode
- Exit if ALLOWED_HOSTS not defined

* Tweak error message

* Use whitenoise for serving static files

- Any requests to /static/ are handled by whitenoise
- If an external reverse proxy (e.g. Caddy) is being used, this will not make a difference

* Update python package requirements

* Add extra log output

* Update ENV for CI checks

* Updates

- Thow error but do not exit
- Revert CI changes
2024-03-08 11:11:30 +11:00
Oliver
8aab19b578
Fix for RelatedModelField (#6657)
- Cache initial data in memo
- Fixes https://github.com/inventree/InvenTree/issues/6654
2024-03-07 23:13:57 +11:00
Oliver
d842942fa9
Fix comment in docker-compose.yml (#6656)
- Reference Caddy, not nginx
2024-03-07 14:40:09 +11:00
Oliver
c48669cf8f
Fix data migration (#6652)
- Force part.0109 to be non-atomic
- Ref: https://github.com/inventree/InvenTree/discussions/6641
2024-03-06 21:40:36 +00:00
Oliver
0f89e21611
In debug mode, allow CORS from localhost origins (#6650)
* In debug mode, allow CORS from localhost origins

- Should allow more reliable connection from the vite frontend dev server

* Allow regex pattern to be specified externally

* Update docs
2024-03-07 08:15:05 +11:00
Oliver
e1f606e64f
New Crowdin updates (#6640)
* updated translation base

* 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: New translations messages.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

* Update ru translations

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-07 00:25:39 +11:00
Matthias Mair
6eddb18d48
Add polar to funding page (#6639) 2024-03-05 11:39:47 +11:00
Lukas
e4d2e2f96b
PUI Template editor (#6541)
* Added first POC for label editor

* Added preview item selection

* Split code

* Fix import

* Use liquid lang and added custom tooltips

* Auto load first item for preview and add BOM part assembly filter

* Make the save&reload action more obvious

* Make save optional and use server stored template

* Fix icons and inherit model url

* Add label/report extra fields to serializer and default templates

* Bump api version to v176

* Remove generic and pass template to editor

* Added error overlay

* Moved default tempaltes in default folder

* Only show detail drawer back button if necessary

* Rename action dropdown disabled to hidden and add loading disabled to template editor

* Fix types

* Add icons to editor/preview tabs

* Add draggable split pane and make editors use full height

* Add SplitButton component

* add code editor tag description

* fix related model field if empty string

* remove debug console.log

* move code editor/pdf preview into their own folder

* Update api_version.py

* add support for multiple editors

* fix template editor error handleing while loading/saving code

* add documentation for the template editor
2024-03-05 07:58:12 +11:00
Oliver
950bda4ef6
Fix grpcio version (#6635)
- Pinned in https://github.com/inventree/InvenTree/pull/6621 (for testing)
- Accidentally left in uploaded code
2024-03-04 12:17:09 +00:00
Oliver
cbc879f618
[Docker] Fix broken image (#6621)
* Install grpcio faster

- Pin version
- Update build packages

* Test dockerfile before push

- SImply test if invoke is present

* Revert commit to docker-compose

* Remove VIRTUAL_ENV from Dockerfile

* Fix pip install

* Run extra checks on docker image

* Ensure mariadb links are installed:

- Closes https://github.com/inventree/InvenTree/issues/6625

* Adjust CI

 build docker image manually

* Should fail

- Test that revert fails CI

* Ok, this should break it

* Fix Dockerfile
2024-03-04 22:50:00 +11:00
Oliver
b19def7a1e
offload_task: log errors (#6620)
- Log any errors raised during offload_task
2024-03-02 07:21:45 +00:00
Oliver
c6f43efef8
Run build completion in background (#6619)
- Long running tasks pushed to background worker
- Closes https://github.com/inventree/InvenTree/issues/5157
2024-03-02 07:20:23 +00:00
Oliver
895e2ccf65
Version number: (#6617)
- Bump to 0.15.0 dev
2024-03-02 00:55:48 +00:00
Oliver
3b9fae6279
docker: push both multiple image tags (#6614)
* docker: push both multiple image tags

* Remove matrix strategy
2024-03-02 11:29:20 +11:00
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