Commit Graph

25 Commits

Author SHA1 Message Date
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
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
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
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
Lukas
aa7eaaab3a
Machine integration (#4824)
* Added initial draft for machines

* refactor: isPluginRegistryLoaded check into own ready function

* Added suggestions from codereview

* Refactor: base_drivers -> machine_types

* Use new BaseInvenTreeSetting unique interface

* Fix Django not ready error

* Added get_machines function to driver

- get_machines function on driver
- get_machine function on driver
- initialized attribute on machine

* Added error handeling for driver and machine type

* Extended get_machines functionality

* Export everything from plugin module

* Fix spelling mistakes

* Better states handeling, BaseMachineType is now used instead of Machine Model

* Use uuid as pk

* WIP: machine termination hook

* Remove termination hook as this does not work with gunicorn

* Remove machine from registry after delete

* Added ClassProviderMixin

* Check for slug dupplication

* Added config_type to MachineSettings to define machine/driver settings

* Refactor helper mixins into own file in InvenTree app

* Fixed typing and added required_attributes for BaseDriver

* fix: generic status import

* Added first draft for machine states

* Added convention for status codes

* Added update_machine hook

* Removed unnecessary _key suffix from machine config model

* Initil draft for machine API

* Refactored BaseInvenTreeSetting all_items and allValues method

* Added required to InvenTreeBaseSetting and check_settings method

* check if all required machine settings are defined and refactor: use getattr

* Fix: comment

* Fix initialize error and python 3.9 compability

* Make machine states available through the global states api

* Added basic PUI machine admin implementation that is still in dev

* Added basic machine setting UI to PUI

* Added machine detail view to PUI admin center

* Fix merge issues

* Fix style issues

* Added machine type,machine driver,error stack tables

* Fix style in machine/serializers.py

* Added pui link from machine to machine type/driver drawer

* Removed only partially working django admin in favor of the PUI admin center implementation

* Added required field to settings item

* Added machine restart function

* Added restart requird badge to machine table/drawer

* Added driver init function

* handle error functions for machines and registry

* Added driver errors

* Added machine table to driver drawer

* Added back button to detail drawer component

* Fix auto formatable pre-commit

* fix: style

* Fix deepsource

* Removed slug field from table, added more links between drawers, remove detail drawer blur

* Added initial docs

* Removed description from driver/machine type select and fixed disabled driver select if no machine type is selected

* Added basic label printing implementation

* Remove translated column names because they are now retrieved from the api

* Added printer location setting

* Save last 10 used printer machine per user and sort them in the printing dialog

* Added BasePrintingOptionsSerializer for common options

* Fix not printing_options are not properly casted to its internal value

* Fix type

* Improved machine docs

* Fix docs

* Added UNKNOWN status code to label printer status

* Skip machine loading when running migrations

* Fix testing?

* Fix: tests?

* Fix: tests?

* Disable docs check precommit

* Disable docs check precommit

* First draft for tests

* fix test

* Add type ignore

* Added API tests

* Test ci?

* Add more tests

* Added more tests

* Bump api version

* Changed driver/base driver naming schema

* Added more tests

* Fix tests

* Added setting choice with kwargs and get_machines with initialized=None

* Refetch table after deleting machine

* Fix test

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2024-02-14 14:13:47 +00:00
Oliver
676bb02f6e
Prevent notify_users if importing or migrating (#6415)
* Prevent notify_users if importing or migrating

* Comment out format line
2024-02-05 13:53:55 +00:00
Matthias Mair
4869d0dab8
Add mermaid to docs (#5405)
* move devcontainer docs

* rename bare metal pages

* fix backlinks

* Add getting started for devs

* add mermaid

* include contrib in docs

* use another plugin

* include everything

* update doc checks

* fix install command

* Update mkdocs.yml

* Update mkdocs.yml

* Update starting.md

* Update starting.md

* Update starting.md

* extend requirements

* Update mkdocs.yml

* clean diff

* clean diff + check if it works

* fix CI check for custom tags

* clean md
2024-02-05 21:40:38 +11:00
Oliver
99c92ff655
Sales order barcode allocate (#6072)
* Bug fix for BarcodePOReceive endpoint

- Existing scan must match "stockitem" to raise an error

* bug fix: barcode.js

- Handle new return data from barcode scan endpoint

* Add barcode endpoint for allocating stock to sales order

* Improve logic for preventing over allocation of stock item to sales order

* Test for sufficient quantity

* Bump API version

* Bug fix and extra check

* Cleanup unit tests

* Add unit testing for new endpoint

* Add blank page for app sales orders docs

* Add docs for new barcode features in app

* Fix unit tests

* Remove debug statement
2023-12-14 11:13:50 +11:00
Lavissa
44614493e9
Forgot to add the new page to nav :) (#5978) 2023-11-24 09:41:34 +11:00
Michael
f409cd6894
Added example for barcode plugin (#5670)
* Added example for barcode plugin

* Add some words in stock location reports

* Correct error in link

* Correct error in link

* Typo in link

* Style in code example
2023-10-17 10:24:05 +11:00
Oliver
c7eb90347a
Exchange rate plugin (#5667)
* Add plugin mixin class for supporting exchange rates

* Split some mixin classes out into their own files

- mixins.py is becoming quite bloated!

* Add some new settings for controlling currency updates

* Adds basic plugin implementation

* Refactor existing implementation

- Builtin plugin uses frankfurter.app API
- Better error / edge case handlign

* Add sample plugin for currency exchange

* Allow user to select which plugin to use for plugin updates

* Observe user-configured setting for how often exchange rates are updated

* Updates for some of the sample plugins

* Fix plugin slug

* Add doc page

* Document simple example

* Improve sample

* Add blank page for currency settings info

* More info in "config" page

* Update docs again

* Updated unit tests

* Fill out default settings values when InvenTree runs

* Add log messages

* Significant improvement in default settings speed

- Use bulk create
- Be efficient
- Dont' be inefficient

* More strict checks

* Refactor default values implementation

- Don't run at startup
- Run on list API
- Implement generic @classmethod
2023-10-05 21:19:28 +11:00
Oliver
6d3978ea28
Add database model for defining custom units (#5268)
* Add database model for defining custom units

- Database model
- DRF serializer
- API endpoints

* Add validation hook

* Custom check for the 'definition' field

* Add settings page for custom units

- Table of units
- Create / edit / delete buttons

* Allow "unit" field to be empty

- Not actually required for custom unit definition

* Load custom unit definitions into global registry

* Docs: add core concepts page(s)

* Add some back links

* Update docs

* Add unit test for custom unit conversion

* More unit testing

* remove print statements

* Add missing table rule
2023-07-19 06:24:16 +10:00
Oliver
8d16abcefb
Build line labels (#5034)
* Adds BuildLineLabel model

- New type of label for printing against BuildLine objects

* Add serializer for new model

* Add API endpoints for new label type

* Add hooks to BuildLine table

* Create default label

- Create an example BuildLineLabel object

* Add admin integration

* Fix js code

* Use two-tiered template

- Allows base template to be updated

* Improve default label

* Add docs pages for labels

* Update nav

* Documentation for new label

* Add permission role

* Bump API version
2023-06-14 13:07:18 +10:00
Matthias Mair
15ab911da6
Add more version information (#5014)
* Add info for installer, branch, publisher

* include version info

* fix permissions

* fix typo

* add more info

* use GH url

* fix node

* remove publisher

* remove more logging

* Add info to version view

* enable branch discovery when not set

* fix ref to github version

* add branch to about dialog

* use precise plattform information - if no env is set

* fix ref names

* load VERSION info

* rename plattform to target

* extend installer var

* add generic plattform info

* add docs for version info

* add more info

* add installer codes

* Ammend navigation
2023-06-12 00:32:03 +10:00
Matthias Mair
005c8341bf
Improve devdocs (#4813)
* move devcontainer docs

* rename bare metal pages

* fix backlinks

* Add getting started for devs

* add mermaid

* include contrib in docs

* use another plugin

* include everything

* update doc checks

* fix install command

* remove mermaid

* remove inclusion tag

* remove empty list item

* readd include-markdown

* use non-conflicting syntax for include

* fix table rendering in mkdocs

* make controbuting embedable

* re-add mermaid

* remove empty section

* resturcture

* remove mermaid again
2023-06-09 10:16:30 +10:00
Oliver
433ea4d0de
Documentation Improvements (#4894)
* Improvements for version banner

- Display at the bottom of the page
- Simplify text

* Use mkdocs version provider

* use 'navigation.instant'

* Support modern mkdocs features

- Much better navigation and improved features

* Content changes

* Add code to find previous versions

* Remove modern python syntax

* display output codes

* Hide version banner

* Extra debug message

* update terminology.md
2023-05-25 22:42:16 +10:00
Oliver
5c7303fd53
Update mkdocs.yml (#4828)
Fix spelling error in docs
2023-05-16 22:56:07 +10:00
Oliver
b2ceac2c4a
[Feature] Scrap Build Outputs (#4800)
* Update docs for status codes

* Adds API endpoint for scrapping individual build outputs

* Support 'buildorder' reference in stock tracking history

* Add page for build output documentation

* Build docs

* Add example build order process to docs

* remove debug statement

* JS lint cleanup

* Add migration file for stock status

* Add unit tests for build output scrapping

* Increment API version

* bug fix
2023-05-13 22:19:35 +10:00
Lukas
17057f4266
Docs/devcontainer (#4787)
* Added empty problemMatchers to prevent vscode from asking

* Added first draft for devcontainer docs

* Add 3rd space to tips

* Fix wording

* Add 4rd space to tips

* Refphased intro text

* Fixed spelling mistakes and added note

* Added dynamic variables for devcontainer

* Added missing containerWorkspaceFolder vars other devcontainer files

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>

* Added note for inventree core intelicense for plugin devs

* Added where is dev data stored question to faq

* Update docs/docs/start/devcontainer.md

* update toc

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
Co-authored-by: Matthias Mair <code@mjmair.com>
2023-05-12 17:13:48 +10:00
Oliver
d7f75d3ab3
Project code docs (#4772)
* Add page for project code docs

* Add details on project codes

* more docs
2023-05-05 23:59:30 +10:00
Matthias Mair
f5c2591fd4
Add 'Tag' management (#4367)
* 'Tag' management
Fixes #83

* Add for ManufacturerPart, SupplierPart

* Add tags for StockLocation, StockItem

* fix serializer definition

* add migrations

* update pre-commit

* bump dependencies

* revert updates

* set version for bugbear

* remove bugbear

* readd bugbear remove isort

* and remove bugbear again

* remove bugbear

* make tag fields not required

* add ruleset

* Merge migrations

* fix migrations

* add unittest for detail

* test tag add

* order api

* reduce database access

* add tag modification test

* use overriden serializer to ensuer the manager is always available

* fix typo

* fix serializer

* increae query thershold by 1

* move tag serializer

* fix migrations

* content_types are changing between tests - removing them

* remove unneeded fixture

* Add basic docs

* bump API version

* add api access to the docs

* add python code

* Add tags to search and filters for all models
2023-05-04 09:02:48 +10:00
Oliver
ad4acef459
Plugin metadata docs (#4724)
* Add page for model metadata

* Add intro section

* Add info on direct access

* more updates
2023-05-01 23:33:44 +10:00
Oliver
e2c3b28640
Company docs updates (#4710)
* Refactor order documentation into simpler consolidated pages

* Reorganize images

* Add documentation on "Contact"

* Add imgae
2023-04-27 22:27:21 +10:00
Oliver
50cbaff76d
Fixes for docs building (#4659) 2023-04-22 23:35:25 +10:00
Oliver
2ffd2354eb
Documentation integration (#4653)
* Add documentation under docs/ directory

* Add CI workflow for mkdocs configuration checking

* Add documentation issue template

* update pip-tools?

* Update .gitignore files

* Fix .gitignore rules

* Improve release notes page

* remove references to old repo
2023-04-22 22:40:29 +10:00