2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-05-03 16:08:56 +00:00

Merge branch 'master' of https://github.com/inventree/inventree-docs into new-plugin

This commit is contained in:
Matthias Mair 2022-01-08 18:41:52 +01:00
commit 8bfeb0f271
80 changed files with 271 additions and 66 deletions

@ -68,6 +68,19 @@ currencies:
# Email backend configuration
# Ref: https://docs.djangoproject.com/en/dev/topics/email/
# Available options:
# host: Email server host address
# port: Email port
# username: Account username
# password: Account password
# prefix: Email subject prefix
# tls: Enable TLS support
# ssl: Enable SSL support
# Alternatively, these options can all be set using environment variables,
# with the INVENTREE_EMAIL_ prefix:
# e.g. INVENTREE_EMAIL_HOST / INVENTREE_EMAIL_PORT / INVENTREE_EMAIL_USERNAME
# Refer to the InvenTree documentation for more information
email:
# backend: 'django.core.mail.backends.smtp.EmailBackend'
@ -83,11 +96,33 @@ email:
# Use the environment variable INVENTREE_DEBUG
debug: True
# Set debug_toolbar to True to enable a debugging toolbar for InvenTree
# Note: This will only be displayed if DEBUG mode is enabled,
# and only if InvenTree is accessed from a local IP (127.0.0.1)
debug_toolbar: False
# Configure the system logging level
# Use environment variable INVENTREE_LOG_LEVEL
# Options: DEBUG / INFO / WARNING / ERROR / CRITICAL
log_level: WARNING
# Allowed hosts (see ALLOWED_HOSTS in Django settings documentation)
# A list of strings representing the host/domain names that this Django site can serve.
# Default behaviour is to allow all hosts (THIS IS NOT SECURE!)
allowed_hosts:
- '*'
# Cross Origin Resource Sharing (CORS) settings (see https://github.com/ottoyiu/django-cors-headers)
# Following parameters are
cors:
# CORS_ORIGIN_ALLOW_ALL - If True, the whitelist will not be used and all origins will be accepted.
allow_all: True
# CORS_ORIGIN_WHITELIST - A list of origins that are authorized to make cross-site HTTP requests. Defaults to []
# whitelist:
# - https://example.com
# - https://sub.example.com
# MEDIA_ROOT is the local filesystem location for storing uploaded files
# By default, it is stored under /home/inventree/data/media
# Use environment variable INVENTREE_MEDIA_ROOT
@ -97,3 +132,47 @@ media_root: '/home/inventree/data/media'
# By default, it is stored under /home/inventree/data/static
# Use environment variable INVENTREE_STATIC_ROOT
static_root: '/home/inventree/data/static'
# Optional URL schemes to allow in URL fields
# By default, only the following schemes are allowed: ['http', 'https', 'ftp', 'ftps']
# Uncomment the lines below to allow extra schemes
#extra_url_schemes:
# - mailto
# - git
# - ssh
# Login configuration
# How long do confirmation mail last?
# Use environment variable INVENTREE_LOGIN_CONFIRM_DAYS
#login_confirm_days: 3
# How many wrong login attempts are permitted?
# Use environment variable INVENTREE_LOGIN_ATTEMPTS
#login_attempts: 5
# Permit custom authentication backends
#authentication_backends:
# - 'django.contrib.auth.backends.ModelBackend'
# Custom middleware, sometimes needed alongside an authentication backend change.
#middleware:
# - 'django.middleware.security.SecurityMiddleware'
# - 'django.contrib.sessions.middleware.SessionMiddleware'
# - 'django.middleware.locale.LocaleMiddleware'
# - 'django.middleware.common.CommonMiddleware'
# - 'django.middleware.csrf.CsrfViewMiddleware'
# - 'corsheaders.middleware.CorsMiddleware'
# - 'django.contrib.auth.middleware.AuthenticationMiddleware'
# - 'django.contrib.messages.middleware.MessageMiddleware'
# - 'django.middleware.clickjacking.XFrameOptionsMiddleware'
# - 'InvenTree.middleware.AuthRequiredMiddleware'
# Add SSO login-backends
# social_backends:
# - 'allauth.socialaccount.providers.keycloak'
# Add specific settings
# social_providers:
# keycloak:
# KEYCLOAK_URL: 'https://keycloak.custom/auth'
# KEYCLOAK_REALM: 'master'

Binary file not shown.

Before

(image error) Size: 162 KiB

After

(image error) Size: 44 KiB

Binary file not shown.

Before

(image error) Size: 108 KiB

After

(image error) Size: 65 KiB

Binary file not shown.

Before

(image error) Size: 139 KiB

After

(image error) Size: 19 KiB

Binary file not shown.

Before

(image error) Size: 98 KiB

After

(image error) Size: 61 KiB

Binary file not shown.

Before

(image error) Size: 112 KiB

After

(image error) Size: 111 KiB

Binary file not shown.

Before

(image error) Size: 25 KiB

After

(image error) Size: 45 KiB

Binary file not shown.

Before

(image error) Size: 24 KiB

After

(image error) Size: 56 KiB

Binary file not shown.

Before

(image error) Size: 94 KiB

After

(image error) Size: 86 KiB

Binary file not shown.

Before

(image error) Size: 58 KiB

After

(image error) Size: 43 KiB

Binary file not shown.

Before

(image error) Size: 97 KiB

After

(image error) Size: 89 KiB

Binary file not shown.

Before

(image error) Size: 120 KiB

After

(image error) Size: 113 KiB

Binary file not shown.

Before

(image error) Size: 105 KiB

After

(image error) Size: 90 KiB

Binary file not shown.

Before

(image error) Size: 97 KiB

After

(image error) Size: 73 KiB

Binary file not shown.

Before

(image error) Size: 42 KiB

After

(image error) Size: 21 KiB

Binary file not shown.

Before

(image error) Size: 76 KiB

After

(image error) Size: 82 KiB

Binary file not shown.

Before

(image error) Size: 62 KiB

After

(image error) Size: 84 KiB

Binary file not shown.

Before

(image error) Size: 126 KiB

After

(image error) Size: 98 KiB

Binary file not shown.

Before

(image error) Size: 105 KiB

After

(image error) Size: 111 KiB

Binary file not shown.

Before

(image error) Size: 76 KiB

After

(image error) Size: 89 KiB

Binary file not shown.

Before

(image error) Size: 40 KiB

After

(image error) Size: 46 KiB

Binary file not shown.

Before

(image error) Size: 38 KiB

After

(image error) Size: 40 KiB

Binary file not shown.

After

(image error) Size: 53 KiB

Binary file not shown.

Before

(image error) Size: 74 KiB

After

(image error) Size: 73 KiB

Binary file not shown.

Before

(image error) Size: 79 KiB

After

(image error) Size: 82 KiB

Binary file not shown.

Before

(image error) Size: 47 KiB

After

(image error) Size: 67 KiB

Binary file not shown.

Before

(image error) Size: 55 KiB

After

(image error) Size: 49 KiB

Binary file not shown.

After

(image error) Size: 69 KiB

Binary file not shown.

Before

(image error) Size: 60 KiB

After

(image error) Size: 41 KiB

Binary file not shown.

Before

(image error) Size: 64 KiB

After

(image error) Size: 85 KiB

Binary file not shown.

Before

(image error) Size: 21 KiB

After

(image error) Size: 32 KiB

Binary file not shown.

Before

(image error) Size: 58 KiB

After

(image error) Size: 33 KiB

Binary file not shown.

Before

(image error) Size: 88 KiB

After

(image error) Size: 74 KiB

Binary file not shown.

Before

(image error) Size: 32 KiB

After

(image error) Size: 72 KiB

Binary file not shown.

Before

(image error) Size: 58 KiB

After

(image error) Size: 44 KiB

Binary file not shown.

Before

(image error) Size: 16 KiB

After

(image error) Size: 14 KiB

Binary file not shown.

Before

(image error) Size: 42 KiB

After

(image error) Size: 70 KiB

Binary file not shown.

Before

(image error) Size: 30 KiB

After

(image error) Size: 34 KiB

Binary file not shown.

Before

(image error) Size: 93 KiB

After

(image error) Size: 68 KiB

Binary file not shown.

Before

(image error) Size: 36 KiB

After

(image error) Size: 64 KiB

Binary file not shown.

Before

(image error) Size: 110 KiB

After

(image error) Size: 36 KiB

Binary file not shown.

Before

(image error) Size: 52 KiB

After

(image error) Size: 19 KiB

Binary file not shown.

Before

(image error) Size: 106 KiB

After

(image error) Size: 52 KiB

Binary file not shown.

Before

(image error) Size: 62 KiB

After

(image error) Size: 50 KiB

Binary file not shown.

Before

(image error) Size: 22 KiB

After

(image error) Size: 6.3 KiB

Binary file not shown.

Before

(image error) Size: 189 KiB

After

(image error) Size: 124 KiB

Binary file not shown.

Before

(image error) Size: 21 KiB

After

(image error) Size: 22 KiB

Binary file not shown.

Before

(image error) Size: 19 KiB

After

(image error) Size: 30 KiB

Binary file not shown.

Before

(image error) Size: 97 KiB

After

(image error) Size: 47 KiB

Binary file not shown.

Before

(image error) Size: 90 KiB

After

(image error) Size: 45 KiB

Binary file not shown.

Before

(image error) Size: 59 KiB

After

(image error) Size: 42 KiB

Binary file not shown.

Before

(image error) Size: 69 KiB

After

(image error) Size: 44 KiB

Binary file not shown.

Before

(image error) Size: 41 KiB

After

(image error) Size: 44 KiB

Binary file not shown.

Before

(image error) Size: 17 KiB

After

(image error) Size: 36 KiB

Binary file not shown.

Before

(image error) Size: 90 KiB

After

(image error) Size: 21 KiB

Binary file not shown.

Before

(image error) Size: 53 KiB

After

(image error) Size: 21 KiB

Binary file not shown.

Before

(image error) Size: 51 KiB

After

(image error) Size: 22 KiB

Binary file not shown.

Before

(image error) Size: 59 KiB

After

(image error) Size: 38 KiB

Binary file not shown.

Before

(image error) Size: 28 KiB

After

(image error) Size: 18 KiB

Binary file not shown.

Before

(image error) Size: 76 KiB

After

(image error) Size: 40 KiB

Binary file not shown.

Before

(image error) Size: 33 KiB

After

(image error) Size: 27 KiB

Binary file not shown.

Before

(image error) Size: 55 KiB

After

(image error) Size: 23 KiB

Binary file not shown.

Before

(image error) Size: 20 KiB

@ -14,7 +14,7 @@ Multiple default accounts are provided, as detailed below. Each account is affor
| Username | Password | Description |
| --- | --- | --- |
| allacess | nolimits | View / create / edit all pages and items |
| allaccess | nolimits | View / create / edit all pages and items |
| reader | readonly | Can view all pages but cannot create, edit or delete database records |
| engineer | partsonly | Can manage parts, view stock, but no access to purchase orders or sales orders |
| admin | inventree | Superuser account, access all areas plus administrator actions |

@ -8,7 +8,8 @@ You can customize the look of InvenTree via the color themes feature.
### Select Color Theme
Navigate to the "Settings" page and click on the "Theme" tab, you should see the following:
Navigate to the "Settings" page and click on the "Display" tab, you should see the following:
{% with id="theme_default", url="settings/theme_default.png", description="Default InvenTree color theme" %}
{% include 'img.html' %}
{% endwith %}
@ -19,6 +20,7 @@ The drop-down list let's you select any other color theme found in your static f
Color themes are "user specific" which means that changing the color theme in your own settings won't affect other users.
Here is an example what the "Dark Reader" theme looks like:
{% with id="theme_dark", url="settings/theme_dark.png", description="Dark Reader InvenTree color theme" %}
{% include 'img.html' %}
{% endwith %}

@ -47,5 +47,4 @@ invoke worker
```
!!! info "Supervisor"
A better option is to manage the background worker process using a process manager such as supervisor. Refer to the [production server guide](./start/production.md).
A better option is to manage the background worker process using a process manager such as supervisor. Refer to the [production server guide](./start/production.md).

@ -7,8 +7,7 @@ title: Features
InvenTree is an open-source inventory management system which provides intuitive parts management and stock control.
It is designed to be lightweight and easy to use for SME or hobbyist applications, where many existing stock management solutions are bloated and cumbersome to use. However, powerful business logic works in the background to ensure that stock tracking history is maintained, and users have ready access to stock level information. InvenTree is designed to allow for a flexible installation. You could run the InvenTree server on Raspberry Pi SBC and have a simple single-user setup with a lightweight SQLite database. Or it can be run on the "cloud" using MySQL or PostgreSQL and support multiple simultaneous users.
It is designed to be lightweight and easy to use for SME or hobbyist applications, where many existing stock management solutions are bloated and cumbersome to use. However, powerful business logic works in the background to ensure that stock tracking history is maintained, and users have ready access to stock level information. InvenTree is designed to allow for a flexible installation.
InvenTree is a [Python](https://www.python.org/) and [Django](https://www.djangoproject.com/) application which stores data in a relational database, and serves this data to the user(s) via a web browser, and (optionally) can be integrated into custom applications via an API.

@ -22,12 +22,15 @@ For faster input there are several ways to define the wanted serial numbers(SN):
| | `1` | `[1]` | single SN |
| , | `1,3,5` | `[1, 3, 5]` | list of SNs |
| - | `1-5` | `[1, 2, 3, 4, 5]` | strech of SN |
| \<start>+ | `4+` (with 3 numbers needed) | `[4, 5, 6]` | all needed SNs from \<start> |
| \<start>+\<lenght> | `2+2` | `[2, 3, 4]` | \<length> SNs add. to \<start> |
| ~ | `~` (next SN is 8) | `[8]` | represents the next SN |
| `<start>`+ | `4+` (with 3 numbers needed) | `[4, 5, 6]` | all needed SNs from `<start>` |
| `<start>`+`<length>` | `2+2` | `[2, 3, 4]` | `<length>` SNs added to `<start>` |
These rules can be mix-and-matched with whitespaces or commas separating them.
For example:
`1 3-5 9+2` or `1,3-5,9+2` result in `[1, 3, 4, 5, 9, 10, 11]`
`1 3-5 9+2` or `1,3-5,9+2` result in `[1, 3, 4, 5, 9, 10, 11]`
`~+2`(with next SN beeing 14) results in `[14, 15, 16]`
`~+`(with next SN beeing 14 and 2 numbers needed) results in `[14, 15]`
## Build Orders

@ -54,11 +54,29 @@ PR [#2205](https://github.com/inventree/InvenTree/pull/2205) represents a major
PR [#2208](https://github.com/inventree/InvenTree/pull/2208) provides notification emails when the stock level for a particular part falls below the configured "minimum stock" threshold for that part. An email is automatically sent to any users who are subscribed to notifications for that part.
### MFA Support
PR [#2221](https://github.com/inventree/InvenTree/pull/2221) adds support for MFA (multi factor authentication). This enables admins to require all users to enable MFA as a second auth step. Refer to the [documentation](../settings/mfa) for further information.
### Stock Item Forms
PR [#2198](https://github.com/inventree/InvenTree/pull/2198) provides a major refactor of stock item forms, for creating and editing stock items. These forms have been migrated to the REST API, providing a much more responsive user experience.
## Major Bug Fixes
### Session Management
| Pull Request | Description |
| --- | --- |
PR [#2371](https://github.com/inventree/InvenTree/pull/2371) adds management of user settings via the settings page
### Sales Order Shipments
PR [#2199](https://github.com/inventree/InvenTree/pull/2199) adds the ability to perform multiple shipments against a given Sales Order. This allows split-shipments and partial fulfillment of Sales Orders
### Plugin Ecosystem
PR [#2074](https://github.com/inventree/InvenTree/pull/2074) adds a plugin ecosystem, allowing future development of first-party and third-party plugins to extend upon core InvenTree functionality. Watch this space!
### Assign Stock Items to Customer
PR [#2436](https://github.com/inventree/InvenTree/pull/2436) refactors the process by which stock items can be manually assigned to a customer, separate to the Sales Order process.
### Merging Stock Items
PR [#2468](https://github.com/inventree/InvenTree/pull/2468) adds the ability to merge multiple stock items together.

19
docs/settings/MFA.md Normal file

@ -0,0 +1,19 @@
---
title: InvenTree Multi Factor Authentication
---
## Multi Factor Authentication
InvenTree gives the option to use TOTP or statically generated backup tokens as an additional factor to password or SSO authentication. This is a widely adopted security feature on enterprise web services. We highly encourage to enable it if you expose your instance to the public internet.
As TOTP is an [open standard](https://datatracker.ietf.org/doc/html/rfc6238) there are a lot of different ways to hold your key and generate the time based tokens needed for authentication. That ranges from physical devices to password managers and mobile apps. We do not advertise any method but recommend to keep password and token generator seperate from each other.
### Configuration
To make MFA mandatory for all users:
1. Enable it in the [global settings](../settings/global.md).
### Security Consideration
A user can lock themself out if they lose access to both the device with their TOTP app and their backup tokens. An admin can delete their tokens from the admin pages (they exsist under the 'TOTP devices' / 'static devices' models) . This should be a last resort and only done by people knowledgeable about the [admin pages](../settings/admin.md) as changes there might circumvent InvneTrees buisness and security logic.

@ -17,7 +17,15 @@ Global settings are arranged in the following categories:
### Server Settings
Configuration of basic server settings
Configuration of basic server settings.
| Setting | Type | Description | Default |
| --- | --- | --- | --- |
| InvenTree Instance Name | String | String descriptor for the InvenTree server instance | InvenTree Server |
| Use Instance Name | Boolean | Use instance name in title bars | False |
| Base URL | String | Base URL for server instance | *blank* |
| Company Name | String | Company name | My compant name |
| Download from URL | Boolean | Allow downloading of images from remote URLs | False |
### Login Settings
@ -29,6 +37,7 @@ Change how logins, password-forgot, signups are handled.
| Enable SSO | Boolean | Enable SSO on the login-pages | False |
| Enable password forgot | Boolean | Enable password forgot function on the login-pages.<br><br>This will let users reset their passwords on their own. For this feature to work you need to configure E-mail | True |
| E-Mail required | Boolean | Require user to supply e-mail on signup.<br><br>Without a way (e-mail) to contact the user notifications and security features might not work! | False |
| Enforce MFA | Boolean | Users must use multifactor security.<br><br>This forces each user to setup MFA and use it on each autentication | False |
| Mail twice | Boolean | On signup ask users twice for their mail | False |
| Password twice | Boolean | On signup ask users twice for their password | True |
| Auto-fill SSO users | Boolean | Automatically fill out user-details from SSO account-data.<br><br>If this feature is enabled the user is only asked for their username, first- and surname if those values can not be gathered from their SSO profile. This might lead to unwanted usernames bleading over. | True |
@ -37,14 +46,29 @@ Change how logins, password-forgot, signups are handled.
Configuration of barcode functionality
| Setting | Type | Description | Default |
| --- | --- | --- | --- |
| Barcode Support | Boolean | Enable barcode functionality in web interface | True |
### Currencies
Configuration of currency support
| Setting | Type | Description | Default |
| --- | --- | --- | --- |
| Default Currency | Currency | Default currency | USD |
### Reporting
Configuration of report generation
| Setting | Type | Description | Default |
| --- | --- | --- | --- |
| Enable Reports | Boolean | Enable report generation | False |
| Page Size | String | Default page size | A4 |
| Debug Mode | Boolean | Generate reports in debug mode (HTML output) | False |
| Test Reports | Boolean | Enable generation of test reports | False |
### Parts
Configuration of Part options
@ -57,18 +81,39 @@ Configuration of Part Category options
Configuration of Stock Item options
| Setting | Type | Description | Default |
| --- | --- | --- | --- |
| Stock Expiry | Boolean | Enable stock expiry functionality | False |
| Stock Stale Time | Days | Number of days stock items are considered stale before expiring | 90 |
| Sell Expired Stock | Boolean | Allow sale of expired stock | False |
| Build Expired Stock | Boolean | Allow building with expired stock | False |
| Stock Ownership Control | Boolean | Enable ownership control functionality | False |
### Build Orders
Options for build orders
| Setting | Type | Description | Default |
| --- | --- | --- | --- |
| Reference Prefix | String | Prefix for build order reference | BO |
| Reference Regex | String | Regular expression pattern for build order reference | *blank* |
### Purchase Orders
Options for purchase orders
| Setting | Type | Description | Default |
| --- | --- | --- | --- |
| Reference Prefix | String | Prefix for purchase order reference | PO |
### Sales orders
Options for sales orders
| Setting | Type | Description | Default |
| --- | --- | --- | --- |
| Reference Prefix | String | Prefix for sales order reference | SO |
### Plugin Settings
Change into what parts plugins can integrate into.
@ -78,4 +123,4 @@ Change into what parts plugins can integrate into.
| Enable URL integration | Boolean | Enable plugins to add URL routes | False |
| Enable navigation integration | Boolean | Enable plugins to integrate into navigation | False |
| Enable setting integration | Boolean | Enable plugins to integrate into inventree settings | False |
| Enable app integration | Boolean | Enable plugins to add apps | False |
| Enable app integration | Boolean | Enable plugins to add apps | False |

@ -10,24 +10,41 @@ User settings are arranged in the following categories:
### Account
User account configuration
User account configuration, including:
- Account management
- Session management
- Authentication options
- Theme selection
- Language selection
### Home Page
Customize display of items on the InvenTree home page
### Search
Customize settings for search results
| Setting | Type | Description | Default |
| --- | --- | --- | --- |
| Search Preview Results | Integer | Number of results to show in search preview window | 10 |
| Search Show Stock | Boolean | Display stock levels in part search results | True |
| Hide Inactive Parts | Boolean | Hide inactive parts in search preview | False |
### Labels
Settings for label printing
| Setting | Type | Description | Default |
| --- | --- | --- | --- |
| Inline Label Display | Boolean | Display PDF labels in the browser | True |
### Reports
Settings for report generation
### Forms
Customize behavior of modal forms
| Setting | Type | Description | Default |
| --- | --- | --- | --- |
| Inline Report Display | Boolean | Display PDF reports in the browser | False |

@ -16,13 +16,12 @@ Docker images are available with the following tags:
| --- | --- |
| **inventree:stable** | The most recent *stable* release version of InvenTree |
| **inventree:latest** | The most up-to-date *development* version of InvenTree. |
| **inventree:tag** | Specific tagged images are built for each tagged release of InvenTree |
| **inventree:_tag_** | Specific tagged images are built for each tagged release of InvenTree |
### Docker Compose
InvenTree provides sample docker-compose files to get you up and running.
| Compose File | Target | Description |
- A *production* compose file is intended to be used in a production environment, running the web server behind a nginx proxy.
- A *development* compose file provides a simple way to spin up a development environment

@ -13,6 +13,9 @@ There are some key differences compared to the [docker production setup](./docke
- The django webserver is used, instead of running behind Gunicorn
- The server will automatically reload when code changes are detected
!!! info "Static and Media Files"
The development server runs in DEBUG mode, and serves static and media files natively.
The [InvenTree docker image](https://github.com/inventree/InvenTree/blob/master/docker/Dockerfile) uses a [multi-stage build](https://docs.docker.com/develop/develop-images/multistage-build/) process to allow both production and development setups from the same image. The key difference is that the production image is pre-built using InvenTree source code from GitHub, while the development image uses the source code from your local machine (allowing live code updates).
### Docker Compose
@ -23,12 +26,27 @@ This script specifies the following containers:
| Container | Description |
| --- | --- |
| inventree-dev-db | Database image (PostgreSQL) |
| inventree-dev-server | Web server using the django development server |
| inventree-dev-worker | Background task manager |
!!! success "Works out of the box"
You should not need to make any changes to the `docker-compose.dev.yml` file to run the development docker container
#### PostgreSQL Database
A PostgreSQL database container requires a username:password combination (which can be changed). This uses the official [PostgreSQL image](https://hub.docker.com/_/postgres).
*__Note__: An empty database must be manually created as part of the setup (below)*.
#### Web Server
Runs an InvenTree web server instance, powered by Django's built-in webserver.
#### Background Worker
Runs the InvenTree background worker process.
### Environment Variables
Environment variables for the docker containers can be found in the file `dev-config.env` in the `docker` directory.
@ -57,20 +75,45 @@ docker-compose -f docker-compose.dev.yml build
### Create Database
!!! info "First Run Only"
If this is the first time you are interacting with the docker containers, the InvenTree database has not yet been created.
!!! success "First Run Only"
This command only needs to be executed on the first run, if the development database has not already been initialized
Run the following command to open a shell session for the database
```
docker-compose -f docker-compose.dev.yml run inventree-dev-server pgcli -h inventree-dev-db -p 5432 -u pguser
```
!!! info "User"
If you have changed the `POSTGRES_USER` variable in the compose file, replace `pguser` with the different username.
You will be prompted to enter the database user password (default="pgpassword", unless altered in the compose file).
Once logged in, run the following command in the database shell:
```
create database inventree;
```
Then exit the shell with <kbd>Ctrl</kbd>+<kbd>d</kbd>
### Database Setup
The database has now been created, but it is empty! Perform the initial database setup by running the following command:
```
docker-compose -f docker-compose.dev.yml run inventree-dev-server invoke update
```
This command performs the following tasks:
This command performs the following steps:
- Install required python packages into a local python virtual environment
- Create an SQLite database and perform schema migrations
- Collect static files
- Ensure required python packages are installed
- Perform the required schema updates to create the required database tables
- Update translation files
### Create Superuser
### Create Admin Account
!!! info "First Run Only"
This command only needs to be executed on the first run, if you have not already created a superuser account for the database
@ -101,7 +144,7 @@ Once initial setup is complete, stopping and restarting the services is much sim
To stop the InvenTree development server, simply run the following command:
```
docker-compose -f docker-compose-dev.yml down
docker-compose -f docker-compose.dev.yml down
```
### Start InvenTree Services

@ -33,7 +33,7 @@ The example docker-compose file launches the following containers:
#### PostgreSQL Database
A postgresql database container which creates a postgres user:password combination (which can be changed). This uses the official [PostgreSQL image](https://hub.docker.com/_/postgres).
A PostgreSQL database container which requires a username:password combination (which can be changed). This uses the official [PostgreSQL image](https://hub.docker.com/_/postgres).
*__Note__: An empty database must be manually created as part of the setup (below)*.
@ -116,7 +116,7 @@ This starts the database container (in this example, a PostgreSQL server).
### Create Database
If this is the first time we are interacting with the docker containers, the InvenTree database has not yet been created.
If this is the first time you are interacting with the docker containers, the InvenTree database has not yet been created.
!!! success "First Run Only"
If you have already created the InvenTree database you can progress to the next step
@ -128,7 +128,7 @@ docker-compose run inventree-server pgcli -h inventree-db -p 5432 -u pguser
```
!!! info "User"
If you have changed the `POSTGRES_USER` variable in the compose file, replace `pguser` with the different user.
If you have changed the `POSTGRES_USER` variable in the compose file, replace `pguser` with the different username.
You will be prompted to enter the database user password (default="pgpassword", unless altered in the compose file).

@ -190,24 +190,6 @@ mysql> EXIT;
!!! info "Username / Password"
You should change the username and password from the values specified above. This username and password will also be for the InvenTree database connection configuration.
### SQLite
SQLite uses a simple portable database file which is easy to use for debug and testing purposes.
Install required packages as follows:
!!! info "Sudo Actions"
Perform sudo actions from a separate shell, as 'inventree' user does not have sudo access
```
sudo apt-get install sqlite3
```
A `.sqlite3` database file will be automatically created, at the location specified in the configuration options. No further steps necessary.
!!! warning "SQLite Case Sensitivity"
SQLite has a known [string matching limitation](https://docs.djangoproject.com/en/dev/ref/databases/#substring-matching-and-case-sensitivity) for non ASCII characters. If you are using non ASCII characters (e.g. Cyrillic text), it is recommended that you do not use SQLite, as search functionality will not work correctly.
## Configure InvenTree Options
Once the required software packages are installed and the database has been created, the InvenTree server options must be configured.

@ -6,7 +6,6 @@ title: Migrating Data
In the case that data needs to be migrated from one database installation to another, the following procedure can be used to export data, initialize the new database, and re-import the data.
For example, if you wish to migrate from an SQLite database backend to a MySQL database backend, you will need to export the data into a standardized format, and then read it back in to the new database.
!!! warning "Backup Database"
Ensure that the original database is securely backed up first!

@ -28,22 +28,6 @@ The stock status is displayed as a label in the header of each stock item detail
## Update Status
### Single Item
To change the status of an individual stock item, click on the status label displayed in the stock item view, then select the new status:
{% with id="stock_status_change", url="stock/stock_status_change.png", description="Stock Status Change" %}
{% include 'img.html' %}
{% endwith %}
Submit the form then the label will be updated:
{% with id="stock_status_label_updated", url="stock/stock_status_label_updated.png", description="Stock Status Label Updated" %}
{% include 'img.html' %}
{% endwith %}
### Multiple Items
In the "Stock" tab of the part view, select all stock items which stock status needs to be updated:
{% with id="stock_status_change_multiple", url="stock/stock_status_change_multiple.png", description="Stock Status Status Multiple" %}

16
main.py

@ -1,8 +1,24 @@
import os
from posixpath import dirname
from urllib import request
def define_env(env):
# Ensure that the config template is always up to date
CFG_URL = "https://raw.githubusercontent.com/inventree/InvenTree/master/InvenTree/config_template.yaml"
response = request.urlopen(CFG_URL)
print(f"Reading config template from GitHub: Response {response.status}")
if response.status == 200:
data = response.read()
if len(data) > 0:
with open("_includes/config.yaml", "w") as f:
f.write(str(data.decode()))
@env.macro
def listimages(subdir):
"""

@ -95,12 +95,13 @@ nav:
- Order: report/order.md
- Barcodes: report/barcodes.md
- Context Variables: report/context_variables.md
- Settings:
- Admin:
- Global Settings: settings/global.md
- User Settings: settings/user.md
- Admin Interface: settings/admin.md
- User Permissions: settings/permissions.md
- Single Sign on: settings/SSO.md
- Multi Factor Authentication: settings/MFA.md
- Export Data: settings/export.md
- Import Data: settings/import.md
- Python Shell: settings/shell.md