2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-04-27 21:26:43 +00:00

Initial commit

- Copied from inventree.github.io
This commit is contained in:
Oliver Walters 2020-09-21 22:19:42 +10:00
commit 3483c85380
62 changed files with 1814 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
# Ignore python environment files
env-inv-doc/

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 InvenTree
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

33
README.md Normal file
View File

@ -0,0 +1,33 @@
# InvenTree.github.io
This repository hosts the user documentation for [InvenTree](https://github.com/inventree/inventree), an open source inventory management system.
To serve this documentation locally (e.g. for development), you will need to have Python 3 installed on your system.
## Setup
Run the following commands from the top-level project directory:
```
$ git clone https://github.com/inventree/inventree-docs
$ cd inventree-docs
$ python3 -m venv env-inv-doc
$ source env-inv-doc/bin/activate
$ pip install -r requirements.txt
```
## Serve Locally
To serve the pages locally, run the command (from the top-level project directory)
```
$ mkdocs serve
```
## Edit Documentation Files
Once the server is running, it will monitor the documentation files for any changes, and update the served pages.
## Credits
This documentation makes use of the [mkdocs-material template](https://github.com/squidfunk/mkdocs-material)

106
_includes/config.yaml Normal file
View File

@ -0,0 +1,106 @@
# Database backend selection - Configure backend database settings
# Ref: https://docs.djangoproject.com/en/2.2/ref/settings/#std:setting-DATABASES
# Specify database parameters below as they appear in the Django docs
database:
# Example configuration - sqlite (default)
ENGINE: django.db.backends.sqlite3
NAME: '../inventree_default_db.sqlite3'
# For more complex database installations, further parameters are required
# Refer to the django documentation for full list of options
# Example Configuration - MySQL
#ENGINE: django.db.backends.mysql
#NAME: inventree
#USER: inventree_username
#PASSWORD: inventree_password
#HOST: ''
#PORT: ''
# Select default system language (default is 'en-us')
language: en-us
# Set debug to False to run in production mode
debug: True
# 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 in a directory named 'inventree_media' local to the InvenTree directory
# This should be changed for a production installation
media_root: '../inventree_media'
# STATIC_ROOT is the local filesystem location for storing static files
# By default it is stored in a directory named 'inventree_static' local to the InvenTree directory
static_root: '../inventree_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
# 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
# Backup options
# Set the backup_dir parameter to store backup files in a specific location
# If unspecified, the local user's temp directory will be used
#backup_dir: '/home/inventree/backup/'
# Sentry.io integration
# If you have a sentry.io account, it can be used to log server errors
# Ensure sentry_sdk is installed by running 'pip install sentry-sdk'
sentry:
enabled: False
# dsn: add-your-sentry-dsn-here
# LaTeX report rendering
# InvenTree uses the django-tex plugin to enable LaTeX report rendering
# Ref: https://pypi.org/project/django-tex/
# Note: Ensure that a working LaTeX toolchain is installed and working *before* starting the server
latex:
# Select the LaTeX interpreter to use for PDF rendering
# Note: The intepreter needs to be installed on the system!
# e.g. to install pdflatex: apt-get texlive-latex-base
enabled: False
interpreter: pdflatex
# Extra options to pass through to the LaTeX interpreter
options: ''
# 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'

8
_includes/donate.html Normal file
View File

@ -0,0 +1,8 @@
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_donations" />
<input type="hidden" name="business" value="T4M976M5URSUE" />
<input type="hidden" name="currency_code" value="AUD" />
<input type="image" src="https://www.paypalobjects.com/en_AU/i/btn/btn_donateCC_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" />
<img alt="" border="0" src="https://www.paypal.com/en_AU/i/scr/pixel.gif" width="1" height="1" />
</form>

View File

@ -0,0 +1,5 @@
import multiprocessing
bind = "0.0.0.0:8000"
workers = multiprocessing.cpu_count() * 2 + 1

24
_includes/img.html Normal file
View File

@ -0,0 +1,24 @@
<figure class='image'>
{% if id %}
<!-- The link that, when clicked, will display the image in full screen -->
<a href="#{{ id }}">
{% elif url %}
<a href="/assets/images/{{ url }}">
{% endif %}
<img class='img-inline' src='/assets/images/{{ url }}' alt='{{ description }}' title='{{ description }}'
{% if maxwidth or maxheight %}style='
{% if maxwidth %} max-width:{{ maxwidth }};{% endif %}
{% if maxheight %} max-height: {{ maxheight }};{% endif %}
'{% endif %}
>
{% if id or url %}
</a>
{% endif %}
{% if id %}
<!-- The full screen image, hidden by default -->
<a href="#_" class="overlay" id="{{ id }}">
<img src="/assets/images/{{ url }}" alt="{{ description }}" />
</a>
{% endif %}
</figure>

View File

@ -0,0 +1,7 @@
{% extends "main.html" %}
{% block content %}
<h1>
<span class="twemoji">{% include ".icons/fontawesome/regular/sad-tear.svg" %}</span>
Uh oh - Page not found...
</h1>
{% endblock %}

43
docs/admin/admin.md Normal file
View File

@ -0,0 +1,43 @@
---
title: InvenTree Admin Interface
layout: page
---
## Admin Interface
Users which have administrator privileges have access to an Admin interface which provides extremely low level control of the database. Every item in the database is available and this interface provides a convenient option for directly viewing and modifying database objects.
!!! warning "Caution"
Admin users should exercise extreme care when modifying data via the admin interface, as performing the wrong action may have unintended consequences!
### Access Admin Interface
To access the admin interface, select the "Admin" option from the drop-down user menu in the top-right corner of the screen. You will be presented with an adminstation panel as shown below:
{% with id="admin", url="admin/admin.png", description="InvenTree Admin Panel" %}
{% include 'img.html' %}
{% endwith %}
### View Database Objects
Database objects can be listed and filtered directly. The image below shows an example of displaying existing part categories.
{% with id="part_cats", url="admin/part_cats.png", description="Display part categories" %}
{% include 'img.html' %}
{% endwith %}
#### Filtering
Some admin views support filtering of results against specified criteria. For example, the list of Part objects can be filtered as follows:
{% with id="filter", url="admin/filter.png", description="Filter part list" %}
{% include 'img.html' %}
{% endwith %}
### Edit Database Objects
Individual database objects can be edited directly in the admin interface. The image below shows an exmple of editing a Part object:
{% with id="edit_part", url="admin/edit_part.png", description="Edit Part object" %}
{% include 'img.html' %}
{% endwith %}

18
docs/admin/export.md Normal file
View File

@ -0,0 +1,18 @@
---
title: Exporting Data
layout: page
---
## Exporting Data
The [Admin Interface](/admin/admin) provides powerful data exporting capability. When displaying a list of items which support exporting (e.g. Part objects), select the "Export" button from the top-right corner:
{% with id="export", url="admin/export.png", description="Data export" %}
{% include 'img.html' %}
{% endwith %}
Multiple data formats are supported for exported data:
{% with id="formats", url="admin/formats.png", description="Data formats" %}
{% include 'img.html' %}
{% endwith %}

9
docs/admin/import.md Normal file
View File

@ -0,0 +1,9 @@
---
title: Importing Data
layout: page
---
## Importing Data
!!! missing "TODO"
This section requires further work

BIN
docs/assets/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

BIN
docs/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

11
docs/build/bom.md vendored Normal file
View File

@ -0,0 +1,11 @@
---
title: Bill of Materials
layout: page
---
## Bill of Materials
A Bill of Materials (BOM) defines the list of component parts required to make an assembly.
!!! missing "TODO"
This section requires further work

9
docs/build/build.md vendored Normal file
View File

@ -0,0 +1,9 @@
---
title: Build
layout: page
---
## Building Parts
!!! missing "TODO"
This section requires further work

14
docs/buy/po.md Normal file
View File

@ -0,0 +1,14 @@
---
title: Purchase Order
layout: page
---
## Purchase Orders
!!! missing "TODO"
This section requires further work
## Line Items
!!! missing "TODO"
This section requires further work

16
docs/buy/supplier.md Normal file
View File

@ -0,0 +1,16 @@
---
title: Suppliers
layout: page
---
## Suppliers
A supplier is an external vendor of parts and raw materials.
!!! missing "TODO"
This section requires further work
## Supplier Parts
!!! missing "TODO"
This section requires further work

37
docs/contribute.md Normal file
View File

@ -0,0 +1,37 @@
---
title: Contributing to InvenTree
layout: page
---
## Contribute to InvenTree
InvenTree is an open source project, and benefits greatly from user contributions.
If you find InvenTree to be useful, and wish to improve the software, please consider contributing:
### Source Code
InvenTree is built using [Python3](https://www.python.org/) and [Django](https://www.djangoproject.com/). Source code is available on [GitHub](https://github.com/inventree/inventree).
Contributions towards the core InvenTree code base are welcomed; either extending current functionality, prodiving new features, or addressing outstanding issues.
### Report Bugs
If you find a bug or a feature that does not work correctly, please report it on [GitHub](https://github.com/inventree/inventree/issues). Reporting bugs is critical to improving the software. If you are able and willing, providing a fix for any outstanding issues would be greatly appreciated.
### Translation
InvenTree provides a translation layer for the web interface, this requires effort from translators to provide multi-lingual support. If you wish to translate InvenTree to a new language (or improve an existing translation), such contributions would be extremely useful. To provide translation improvements, refer to [GitHub](https://github.com/inventree/inventree).
!!! info "Translation Helper Script"
A python script is provided to assist with translation. This script is located at `./InvenTree/script/translate.py`
### Documentation
Documenting a large software project is a challenging and ongoing effort. If you are able to provide assistance in improving this documentation set, please consider doing so! Documentation contributions can be made on [GitHub](https://github.com/inventree/inventree.github.io).
### Donate
If you are unable to provide contributions as listed above, or you find InvenTree to be useful, please consider donating to support its ongoing development.
{% include 'donate.html' %}

34
docs/extend/api.md Normal file
View File

@ -0,0 +1,34 @@
---
title: InvenTree API
layout: page
---
## InvenTree API
InvenTree provides a powerful REST API for interacting with inventory data on the server. Low-level data access and manipulation is available, with integrated user authentication and data validation
### Documentation
The API is self-documenting, and the documentation is provided alongside any InvenTree installation instance. If (for example) you have an InvenTree instance running at `http://127.0.0.1:8000` then the API documentation is available at `http://127.0.0.1:8000/api-doc/`
{% with id="api_doc", url="api/api_doc.png", description="API documentation" %}
{% include 'img.html' %}
{% endwith %}
### Authentication
The API uses token-based authentication for fast data access. To obtain a valid token, perform a GET request to `/api/user/token/` (no data are required).
!!! info "Credentials"
Ensure that a valid username:password combination are supplied as basic authorization headers.
If the supplied user credentials are validated, the server will respond with:
```
HTTP_200_OK
{
token: "usertokendatastring",
}
```
After reception of a valid authentication token, it can be subsequently used to perform token-based authentication.

16
docs/extend/integrate.md Normal file
View File

@ -0,0 +1,16 @@
---
title: Third Party Integrations
layout: page
---
## Third Party Integrations
A list of known third-party InvenTree extensions is provided below. If you have an extension that should be listed here, contact the InvenTree team on [GitHub](https://github.com/inventree/).
### Ki-nTree
[Ki-nTree](https://github.com/sparkmicro/Ki-nTree/) is a fantastic tool for automated creation of [KiCad](https://kicad-pcb.org/) library parts, with direct integration with InvenTree.
### inventree-docker
[inventree-docker](https://github.com/Zeigren/inventree-docker) provides Docker support for InvenTree

58
docs/extend/plugins.md Normal file
View File

@ -0,0 +1,58 @@
---
title: Plugins
layout: page
---
## InvenTree Plugin Architecture
The InvenTree server code supports an extensible plugin architecture, allowing custom plugins to be integrated directly into the database server. This allows development of complex behaviours which are decoupled from core InvenTree code.
InvenTree plugins are located in the directory `./InvenTree/plugins/`.
Plugins are discovered and loaded when the server is started.
Multiple plugins are supported:
### Reporting Plugins
InvenTree can generate customized reports (for example stocktake information, packing lists, acceptance test reports, etc). The reporting interface is extremely versatile, allowing the generation of reports in multiple formats (PDF / LaTeX / etc).
!!! missing "TODO"
Include more information here on reporting plugins
### Barcode Plugins
InvenTree supports decoding of arbitrary barcode data via a **Barcode Plugin** interface. Barcode data POSTed to the `/api/barcode/` endpoint will be supplied to all loaded barcode plugins, and the first plugin to successfully interpret the barcode data will return a response to the client.
InvenTree can generate native QR codes to represent database objects (e.g. a single StockItem). This barcode can then be used to perform quick lookup of a stock item or location in the database. A client application (for example the InvenTree mobile app) scans a barcode, and sends the barcode data to the InvenTree server. The server then uses the **InvenTreeBarcodePlugin** (found at `/InvenTree/plugins/barcode/inventree.py`) to decode the supplied barcode data.
Any third-party barcodes can be decoded by writing a matching plugin to decode the barcode data. These plugins could then perform a server-side action, or render a JSON response back to the client for further action.
Some examples of possible uses for barcode integration:
- Stock lookup by scanning a barcode on a box of items
- Receiving goods against a PurchaseOrder by scanning a supplier barcode
- Perform a stock adjustment action (e.g. take 10 parts from stock whenever a barcode is scanned)
Barcode data are POSTed to the server as follows:
```
POST {
barcode_data: "[(>someBarcodeDataWhichThePluginKnowsHowToDealWith"
}
```
### Action Plugins
Arbitrary "actions" can be called by POSTing data to the `/api/action/` endpoint. The POST request must include the name of the action to be performed, and a matching ActionPlugin plugin must be loaded by the server. Arbitrary data can also be provided to the action plugin via the POST data:
```
POST {
action: "MyCustomAction",
data: {
foo: "bar",
}
}
```
For an example of a very simple action plugin, refer to `/InvenTree/plugins/action/action.py`

120
docs/extend/python.md Normal file
View File

@ -0,0 +1,120 @@
---
title: Python Interface
layout: page
---
## Python Module
A [Python module](https://github.com/inventree/inventree-python) is provided for rapid development of third party scripts or applications using the REST API. The python module handles authentication and API transactions, providing an extremely clean interface for interacting with and manipulating database data.
### Features
- Automatic authentication management using token-based authentication
- Pythonic data access
- Native file uploads
- Powerful functions for accessing related model data
### Installation
The inventree python interface can be easily installed via the [PIP package manager](https://pypi.org/project/inventree/):
```
pip3 install inventree
```
Alternatively, it can downloaded and installed from source, from [GitHub](https://github.com/inventree/inventree-python).
### Examples
The inventree Python module is designed to be very lightweight and simple to use. Some simple examples are provided below:
#### Authentication
Authentication against an InvenTree server is simple:
```python
from inventree.api import InvenTreeAPI
SERVER_ADDRESS = 'http://127.0.0.1:8000'
MY_USERNAME = 'not_my_real_username'
MY_PASSWORD = 'not_my_real_password'
api = InvenTreeAPI(SERVER_ADDRESS, username=MY_USERNAME, password=MY_PASSWORD)
```
Alternatively, if you already have an access token:
```python
api = InvenTreeAPI(SERVER_ADDRESS, token=MY_TOKEN)
```
#### Retrieving Individual Items
If the primary-key of an object is already known, retrieving it from the database is performed as follows:
```python
from inventree.part import PartCategory
category = PartCatgory(api, 10)
```
#### Querying / Listing Items
Database items can be queried by using the `list` method for the given class:
```python
from inventree.part import Part
from inventree.stock import StockItem
parts = Part.list(api, category=10, assembly=True)
items = StockItem.list(api, location=4, part=24)
```
Once an object has been retrieved from the database, its related objects can be returned with helper functions:
```python
part = Part(api, 25)
stock_items = part.getStockItems()
```
Some classes also have helper functions for performing certain actions, such as uploading file attachments or test results:
```python
stock_item = StockItem(api, 1001)
stock_item.uploadTestResult("Firmware", True, value="0x12345678", attachment="device_firmware.bin")
```
#### Creating New Items
```python
from inventree.part import Part, PartCategory
from inventree.stock import StockItem
## Create a new PartCategory object,
## underneath the existing category with pk 7
furniture = PartCategory.create(api, {
'name': 'Furniture',
'description': 'Chairs, tables, etc',
parent, 7
})
## Create a new Part
## Use the pk (primary-key) of the newly created category
couch = Part.create(api, {
'name': 'Couch',
'description': 'Long thing for sitting on',
'category': furniture.pk,
'active': True,
'virtual': False,
## Note - You do not have to fill out *all* fields
})
## Create a new StockItem
item = StockItem.create(api, {
'part': couch.pk,
'quantity': 5,
'notes': 'A stack of couches',
location: 10, ## PK of a StockLocation already in the database...
})
```

63
docs/index.md Normal file
View File

@ -0,0 +1,63 @@
---
title: InvenTree
layout: page
permalink: "/"
---
## InvenTree - Intuitive Inventory Management
InvenTree is an open-source inventory management system which provides intuitive parts management and stock control.
InvenTree 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.
### How it Works
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.
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.
## Features
### Organize Parts
Parts are the fundemental element of any inventory. InvenTree groups parts into structured categories which allow you to arrange parts to meet your particular needs.
[Read more...](part/part)
### Manage Suppliers
Link parts to multiple suppliers,
[Read more...](buy/supplier)
### Instant Stock Knowledge
Instantly view current stock for a certain part, in a particular location, or required for an individual build. Stock items are organized in cascading locations and sub-locations, allowing flexible inspection of stock under any location. Stock items can be serialized for tracking of individual items, and test results can be stored against a serialized stock item for the purpose of acceptance testing and commissioning.
[Read more...](stock/stock)
### BOM Management
Intelligent BOM (Bill of Material) management provides a clear understanding of the sub-parts required to make a new part.
[Read more...](build/bom)
### Build Parts
Consume stock items to make new parts
[Read more...](build/build)
### Report
Generate a wide range of reports using custom templates. [Read more...](docs/report/report)
### Extend and Customize
InvenTree is designed to be highly extensible. If the core InvenTree functionality does not meet your particular need, InvenTree provides a RESTful API, a native Python library, and a powerful plugin system.
[Read more...](extend/api)
## Getting Started
Refer to the [installation guide](start/install) for instructions on installing InvenTree. The server where InvenTree is to be installed will need to meet some basic package requirements, and a certain level of system administration understanding is assumed.

9
docs/part/parameter.md Normal file
View File

@ -0,0 +1,9 @@
---
title: Part Parameters
layout: page
---
## Part Parameters
!!! missing "TODO"
Parameter documentation to be written

30
docs/part/part.md Normal file
View File

@ -0,0 +1,30 @@
---
title: Parts
layout: page
---
# Part
The *Part* is the core element of the InvenTree ecosystem. A Part object is the archetype of any stock item in your inventory. Parts are arranged in heirarchical categories which are used to organise and filter parts by function.
## Part Category
Part categories are very flexible and can be easily arranged to match a particular user requirement. Each part category displays a list of all parts *under* that given category. This means that any part belonging to a particular category, or belonging to a sub-category, will be displayed.
Each part category also shows a list of sub-categories which exist underneath it.
{% with id="part_category", url="part/part_category.png", description="Parts are arranged in categories" %}
{% include 'img.html' %}
{% endwith %}
The category part list provides an overview of each part:
* Part name and description
* Part image thumbnail
* Part category
* Part stock level
The list of parts underneath a given category can be filtered by multiple user-configurable filters, which is especially useful when a large number of parts exist under a certain category.
Clicking on the part name links to the [*Part Detail*](/part/views) view.

9
docs/part/template.md Normal file
View File

@ -0,0 +1,9 @@
---
title: Part Templates
layout: page
---
## Part Templates
!!! missing "TODO"
Parameter documentation to be written

43
docs/part/test.md Normal file
View File

@ -0,0 +1,43 @@
---
title: Part Test Templates
layout: page
---
## Part Test Templates
Parts which are designated as *trackable* (meaning they can be uniquely serialized) can define templates for tests which are to be performed against individual stock items corresponding to the part.
A test template defines the parameters of the test; the individual stock items can then have associated test results which correspond to a test template.
Test templates "cascade" down to variant parts: this means that if a master part has multiple variants, any test template defined for the master part will be assigned to the variants. Any stock items of the variant parts will have the same test templates associated with them.
!!! missing "TODO"
Include pictures of the Test Template tab
### Test Template Parameters
#### Test Name
The name of the test is a simple string value which defines the name of the test. This test must be unique for a given part (or across a set of part variants).
The test name is used to generate a test "key" which is then used to match against test results associated with individual stock items.
#### Test Description
This field is a simple description for providing information back to the user. The description is not used by the InvenTree testing framework.
#### Required
If the *required* flag is set, this indicates that the test is crucial for the acceptance of a particular stock item.
#### Requires Value
If this flag is set, then a corresponding test result against a stock item must set the *value* parameter.
#### Requires Attachment
If this flag is set, then a corresponding test result against a stock item must provide a file attachment uploaded.
### Test Results
Individual stock item objects can have test results associated with them which correspond to test templates. Refer to the [stock test result](/stock/test) documentation for further information.

134
docs/part/views.md Normal file
View File

@ -0,0 +1,134 @@
---
title: Part Views
layout: page
---
The Part information page organizes part data into sections, displayed as tabs.
## Part Details
The *Details* tab shows a detail view which provides information about the particular part.
{% with id="part_overview", url="part/part_overview.png", description="Part details" %}
{% include 'img.html' %}
{% endwith %}
A Part is defined in the system by the following parameters:
### Part Definition Fields
**Part Name** - The Part name is a simple (unique) text label
**Description** - Longer form text field describing the Part
**Internal Part Number (IPN)** - A special code which can be used to link a part to a numbering system. The IPN field is not required, but may be useful where a part numbering system has been defined.
**Revision** - An optional revision code denoting the particular version for the part. Used when there are multiple revisions of the same master part object.
**Category** - The Part category is used to group or arrange parts, as per the particular requirements of the user. Categories are arranged in a 'tree' where each category may have multiple child categories.
**External Link** - An external URL field is provided to link to an external page. This could be useful the part has extra documentation located on an external server.
**Units** - Units of measure (UoM) for this Part. The default is 'pcs'
### Part Options
A Part can provide different functionality based on the following options.
**Virtual** - A *Virtual* part is one which does not physically exist but should still be tracked in the system. This could be a process step, machine time, software license, etc.
**Template** - A *Template* part is one which can have *variants* which exist underneath it. [Read further information about template parts here](/part/template).
**Assembly** - If a part is designated as an *Assembly* it can be created (or built) from other component parts. As an example, a circuit board assembly is made using multiple electronic components, which are tracked in the system. An *Assembly* Part has a Bill of Materials (BOM) which lists all the required sub-components. [Read further information about BOM management here](/build/bom).
**Component** - If a part is designated as a *Component* it can be used as a sub-component of an *Assembly*. [Read further information about BOM management here](/build/bom)
**Trackable** - If a part is designed as *trackable*, it can be tracked using unique serial numbers.
**Purchaseable** - If a part is designated as *Purchaseable* it can be purchased from external suppliers. Setting this flag allows parts to be added to [purchase orders](/buy/po).
**Salable** - If a part is designated as *Salable* it can be sold to external customers. Setting this flag allows parts to be added to sales orders.
**Active** - By default, all parts are *Active*. Marking a part as inactive means it is not available for many actions, but the part remains in the database. If a part becomes obsolete, it is recommended that it is marked as inactive, rather than deleting it from the database.
## Parameters
Parts can have multiple defined [parameters](/part/parameter).
## Variants
If a part is a *Template Part* then the *Variants* tab will be visible. [Part templates](/part/template)
## Stock
The *Stock* tab shows all the stock items for the selected *Part*. The user can quickly determine how many parts are in stock, where they are located, and the status of each *Stock Item*.
{% with id="part_stock", url="part/part_stock.png", description="Part Stock" %}
{% include 'img.html' %}
{% endwith %}
### Functions
The following functions are available from the *Part Stock* view.
#### Export
Exports the stocktake data for the selected Part. Launches a dialog to select export options, and then downloads a file containing data for all stock items for this Part.
#### New Stock Item
Launches a dialog to create a new *Stock Item* for the selected *Part*.
#### Stock Actions
If stock items are selected in the table, stock actions are enabled via the drop-down menu.
## Allocations
The *Allocated* tab displays how many units of this part have been allocated to pending build orders and/or sales orders. This tab is only visible if the Part is a *component* (meaning it can be used to make assemblies), or it is *salable* (meaning it can be sold to customers).
## BOM
The *BOM* tab displays the [Bill of Materials](/build/bom) - a list of sub-components used to build an assembly. Each row in the BOM specifies a quantity of another Part which is required to build the assembly. This tab is only visible if the Part is an *assembly* (meaning it can be build from other parts).
## Build Orders
!!! missing "TODO"
Documentation to be written
## Used In
The *Used In* tab displays a list of other parts that this part is used to make. This tab is only visible if the Part is a *component*.
## Suppliers
The *Suppliers* tab displays all the *Supplier Parts* for the selected *Part*.
This tab is only visible if the *Part* is designated as *Purchaseable*.
{% with id="part_suppliers", url="part/part_suppliers.png", description="Part Suppliers" %}
{% include 'img.html' %}
{% endwith %}
## Purchase Orders
The *Part Purchase Orders* tab lists all the Purchase Orders against the selected part.
This tab is only displayed if the part is marked as *Purchaseable*.
## Sales Orders
!!! missing "TODO"
Documentation to be written
## Tests
If a part is marked as *trackable*, the user can define tests which must be performed on any stock items which are instances of this part. [Read more about testing](/part/test).
## Attachments
The *Part Attachments* tab displays file attachments associated with the selected *Part*. Multiple file attachements (such as datasheets) can be uploaded for each *Part*.
## Notes
A part may have notes attached, which support markdown formatting.

59
docs/report/labels.md Normal file
View File

@ -0,0 +1,59 @@
---
title: Custom Labels
layout: page
---
## Custom Labels
InvenTree supports printing of custom template-based labels, using the [blabel](https://github.com/Edinburgh-Genome-Foundry/blabel) plugin for Python.
Custom labels can be generated using simple HTML templates, with support for QR-codes, and conditional formatting using the Jinja template engine.
!!! info "Documentation"
Refer to the blabel documentation for further information
### Creating Labels
!!! missing "TODO"
This section requires further work
### Stylesheet
!!! missing "TODO"
This section requires further work
### Context Data
Each label template is supplied with *context data* (variables) which can be used to display information based on the context in which the label is printed.
!!! missing "TODO"
This section requires further work
### QR Codes
!!! missing "TODO"
This section requires further work
### Conditional Formatting
!!! missing "TODO"
This section requires further work
## Stock Labels
!!! missing "TODO"
This section requires further work
### Context Data
In addition to the global label context data, the following variables are made available to the StockItem label template:
* item - *The StockItem object itself*
* part - *The Part object which is referenced by the StockItem object*
* name - *The `name` field of the Part object*
* ipn - *The `IPN` field of the Part object*
* quantity - *The `quantity` field of the StockItem object*
* serial - *The `serial` field of the StockItem object*
* uid - *The `uid` field of the StockItem object*
* qrcode - *JSON data representing the StockItem object, useful for rendering to a QR code*
* tests - *Dict object of TestResult data associated with the StockItem*

9
docs/report/order.md Normal file
View File

@ -0,0 +1,9 @@
---
title: Order Report
layout: page
---
## Order Report
!!! missing "TODO"
This section requires further work

9
docs/report/pack.md Normal file
View File

@ -0,0 +1,9 @@
---
title: Packing List Report
layout: page
---
## Packing List
!!! missing "TODO"
This section requires further work

68
docs/report/report.md Normal file
View File

@ -0,0 +1,68 @@
---
title: Report Generation
layout: page
---
## Custom Reporting
InvenTree supports a customizable reporting ecosystem, allowing the user to develop reporting templates that meet their particular needs.
PDF reports can be generated from either [HTML](https://github.com/fdemmer/django-weasyprint) or [LaTeX](https://github.com/weinbusch/django-tex) template files which are written by the user.
Reports are used in a variety of situations to format data in a friendly format for printing, distribution, conformance and testing.
In addition to providing the ability for end-users to provide their own reporting templates, some report types offer "built-in" report templates ready for use.
## Report Types
Following is a list of available report types
* [Test Report](/report/test): Format results of a test report against for a particular StockItem
* [Packing List](/report/pack): Format a list of items for shipping or transfer
* [Order List](/report/order): Order line items
## Template Formats
Report templates can be written in multiple formats as per the requirement of the user. Uploaded template files are passed through the django/jinja rendering framework, and as such accept the same variable template strings as any other django template file.
For example, rendering the name of a part (which is available in the particular template context as *part*) is as follows:
*The name of the part is **\{\{ part.name \}\}**.*
!!! info "Variables"
Templates will have different variables available to them depending on the report type. Read the detail information on each report type for further information.
### HTML
HTML templating uses the [django-weasyprint](https://github.com/fdemmer/django-weasyprint) engine for rendering templated HTML files to PDF.
### LaTeX
LaTeX templating uses the [django-tex](https://github.com/weinbusch/django-tex) engine for rendering templated LaTeX files to PDF. Using LaTeX templates is much more complicated and requires advanced knowledge of configuring a LaTeX install. However it provides a much more powerful framework for generation of publication-quality documents.
!!! info "LaTeX Configuration"
To use LaTeX templating, the system where InvenTree is installed must have a LaTeX toolchain accessible from the command line. Installation of such a toolchain is beyond the scope of this documenation.
!!! info "Special Characters"
Special care must be taken to ensure that the LaTeX template file does not contain any LaTeX control characters that look like jinja template control codes!
#### Intepreter Selection
Out of the box, the LaTeX template rendering system is set to use *pdflatex* as the LaTeX interpreter. However this can easily be changed in the *config.yaml* configuration file:
``` yaml
## LaTeX report rendering
## InvenTree uses the django-tex plugin to enable LaTeX report rendering
## Ref: https://pypi.org/project/django-tex/
latex:
## Select the LaTeX interpreter to use for PDF rendering
## Note: The intepreter needs to be installed on the system!
## e.g. to install pdflatex: apt-get texlive-latex-base
interpreter: pdflatex
## Extra options to pass through to the LaTeX interpreter
options: ''
```
## Uploading Templates
Custom report templates can be uploaded using the [Admin Interface](/admin/admin). Only users with admin access can upload and/or edit report template files.

54
docs/report/test.md Normal file
View File

@ -0,0 +1,54 @@
---
title: Test Report
layout: page
---
## Test Report
InvenTree provides [test result](/stock/test) tracking functionality which allows the users to keep track of any tests which have been performed on a given stock item.
Custom test reports may be generated against any given stock item. All testing data is made available to the template for custom rendering as required.
For example, an "Acceptance Test" report template may be customized to the particular device, with the results for certain tests rendering in a particular part of the page, with any tests which have not passed highlighted.
!!! missing "TODO"
This section requires further work
### Part Filters
A TestReport template may define a set of filters against which parts are sorted. Any Part objects which match the provided filters can use the given TestReport.
This allows each TestReport to easily be assigned to a particular Part, or even multiple parts.
In the example below, a test report template is uploaded and assigned to the part with the name *"My Widget"*. Any combination of fields relevent to the Part model can be used here.
{% with id="test_report_add", url="admin/test_report_add.png", description="Upload test report template" %}
{% include 'img.html' %}
{% endwith %}
### Context Variables
The following context variables are made available to the TestReport template for rendering:
- **stock_item**: The individual stock item for which this test report is being generated
- **part**: The Part of which the stock_item is an instance
- **results**: A dict of test result objects, where the 'key' for each test result is a shortened version of the test name (see below)
- **result_list**: A list of each test result object
#### Results
The *results* context variable provides a very convenient method of callout out a particular test result by name.
#### Example
Say for example that a Part "Electronic Widget" has a stock item with serial number #123, and has a test result uploaded called "Firmware Checksum". The templated file can reference this data as follows:
``` html
<h3>Part: {% raw %}{{ part.name }}{% endraw %}</h3>
<b>Serial Number: {% raw %}{{ stock_item.serial }}{% endraw %}</b>
<hr>
<p>
Firmware Checksum: {% raw %}{{ results.firmwarechecksum.value }}.
Uploaded by {{ results.firmwarechecksum.user }}{% endraw %}
</p>
```

114
docs/start/config.md Normal file
View File

@ -0,0 +1,114 @@
---
title: Database Configuration
layout: page
---
## Database Configuration
Admin users will need to adjust the InvenTree installation to meet the particular needs of their setup. For example, pointing to the correct database backend, or specifying a list of allowed hosts.
The Django configuration parameters are found in the normal place (*settings.py*). However the settings presented in this file should not be adjusted as they will alter the core behaviour of the InvenTree application.
### Configuration File
To support install specific settings, a simple configuration file ``config.yaml`` is provided. This configuration file is loaded by the InvenTree server at runtime. Settings specific to a given install should be adjusted in ``config.yaml``.
!!! info "Config file location"
The InvenTree config file is located at `./InvenTree/config.yaml`
The default configuration file launches a *DEBUG* configuration with a simple SQLITE database backend. This default configuration file is shown below:
``` yaml
{% include 'config.yaml' %}
```
### Database Options
InvenTree provides support for multiple database backends - any backend supported natively by Django can be used.
Database options are specified under the *database* heading in the configuration file. Any option available in the Django documentation can be used here - it is passed through transparently to the management scripts.
<hr>
**SQLite:**
By default, InvenTree uses an sqlite database file : ``inventree_db.sqlite3``. This provides a simple, portable database file that is easy to use for debug and testing purposes.
<hr>
**MySQL:** MySQL database backend is supported with the native Django implemetation. To run InvenTree with the MySQL backend, a number of extra packages need to be installed:
* mysql-server - *MySQL backend server*
* libmysqlclient-dev - *Required for connecting to the MySQL database in Python*
* (pip) mysqlclient - *Python package for communication with MySQL database*
To install these required packages, run the following command:
```
invoke mysql
```
It is then up to the database adminstrator to create a new MySQL database to store inventree data, in addition to a username/password to access the data.
!!! info "MySQL Collation"
When creating the MySQL database, the adminstrator must ensure that the collation option is set to <b>utf8_unicode_520_ci</b> to ensure that InvenTree features function correctly.
The database options (in the `config.yaml` file) then need to be adjusted to communicate the MySQL backend. Refer to the [Django docs](https://docs.djangoproject.com/en/dev/ref/databases/) for further information.
<hr>
**PostgreSQL:** PostgreSQL database backend is supported with the native Django implementation. Note that to use this backend, the following system packages must be installed:
* postgresql
* postgresql-contrib
* libpq-dev
* (pip3) psycopg2
To install these required packages, run the following commands:
```
invoke postgresql
```
It is then up to the database adminstrator to create a new PostgreSQL database to store inventree data, in addition to a username/password to access the data.
The database options (in the ``config.yaml`` file) then need to be adjusted to communicate the PostgreSQL backend. Refer to the [Django docs](https://docs.djangoproject.com/en/dev/ref/databases/) for further information.
### Allowed Hosts / CORS
By default, all hosts are allowed, and CORS requests are enabled from any origin. **This is not secure and should be adjusted for your installation**. These options can be changed in the configuration file.
For further information, refer to the following documentation:
* [Django ALLOWED_HOSTS](https://docs.djangoproject.com/en/2.2/ref/settings/#allowed-hosts)
* [Django CORS headers](https://github.com/OttoYiu/django-cors-headers)
### Static File Storage
By default, static files are stored in the local directory `./inventree_media`. This directory should be changed in the config file based on the particular installation requirements.
### Uploaded File Storage
By default, uploaded media files are stored in the local directory `./inventree_media`. This directory should be changed in the config file based on the particular installation requirements.
### Backup Location
The default behaviour of the database backup is to generate backup files for database tables and media files to the user's temporary directory. The target directory can be overridden by setting the *backup_dir* parameter in the config file.
### Sentry.io Integration
InvenTree supports [sentry.io](https://sentry.io) integration using the native django/sentry bindings. If you have a sentry.io account, create a new dsn and provide this in the `config.yaml` file.
### LaTeX Support
To enable genration of [LaTeX](https://en.wikipedia.org/wiki/LaTeX) reports, latex support must be enabled here.
- **enabled** : Set to True to enable LaTeX support
- **interpreter** : Select the LaTeX interpreter to be used (must be installed on the local machine!)
### Authentication Backends
Custom authentication backends can be used by specifying them here
### Middleware
Custom middleware layers can specified here.

77
docs/start/deploy.md Normal file
View File

@ -0,0 +1,77 @@
---
title: Deploy InvenTree
layout: page
---
## Deploying InvenTree
The development server provided by the Django ecosystem may be fine for a testing environment or small contained setups. However special consideration must be given when deploying InvenTree in a real-world environment.
Django apps provide multiple deployment methods - see the [Django documentation](https://docs.djangoproject.com/en/2.2/howto/deployment/).
There are also numerous online tutorials describing how to deploy a Django application either locally or on an online platform.
### Development Server
The InvenTree development server is useful for testing and configuration - and it may be wholly sufficient for a small-scale installation.
#### Running on a Local Machine
To run the development server on a local machine, run the command:
```
invoke server -a 127.0.0.1:8000
```
Serving on the address `127.0.0.1` means that InvenTree will only be available *on that computer*. The server will be accessible from a web browser on the same computer, but not from any other computers on the local network.
#### Running on a Local Network
To enable access to the InvenTree server from other computers on a local network, you need to know the IP of the computer running the server. For example, if the server IP address is `192.168.120.1`:
```
invoke server -a 192.168.120.1:8000
```
## Gunicorn
Following is a simple tutorial on serving InvenTree using [Gunicorn](https://gunicorn.org/). Gunicorn is a Python WSGI server which provides a multi-worker server which is well suited to handling multiple simultaneous requests. Gunicorn is a solid choice for a production server which is easy to configure and performs well in a multi-user environment.
### Install Gunicorn
Gunicorn can be installed using PIP:
```
pip3 install gunicorn
```
### Configure Static Directories
Directories for storing *media* files and *static* files should be specified in the ``config.yaml`` configuration file. These directories are the ``MEDIA_ROOT`` and ``STATIC_ROOT`` paths required by the Django app. Ensure that both of these directories are correctly configured for your setup.
### Collect Static Files
The required static files must be collected into the specified ``STATIC_ROOT`` directory:
```
invoke static
```
This command collects all of the required static files (including script and css files) into the specified directory ready to be served.
### Configure Gunicorn
The Gunicorn server can be configured with a simple configuration file (e.g. python script). An example configuration file is provided in ``InvenTree/gunicorn.conf.py``
``` python
{% include 'gunicorn.conf.py' %}
```
This file can be used to configure the Gunicorn server to match particular requirements.
### Run Gunicorn
```
cd InvenTree
gunicorn -c gunicorn.conf.py InvenTree.wsgi
```

171
docs/start/install.md Normal file
View File

@ -0,0 +1,171 @@
---
title: Install InvenTree
layout: page
---
## Introduction
The InvenTree server application communicates with a backend database, and serves data to the user(s) via a web framework and an API. Before users can interact with the InvenTree system, the server must be installed and properly configured, and then the server process must be started (at a network location which is accessible to the users).
### Supported Databases
InvenTree can be used by any database backend which is supported by the [Django framework](https://docs.djangoproject.com/en/3.0/ref/databases/):
* SQLite
* PostgreSQL
* MariaDB
* MySQL
* Oracle
Database selection should be determined by your particular installation requirements. By default, InvenTree uses SQLite which provides a simple file-based database that allows a quick setup for development and testing.
### Serving Data
Once a database is setup, you need a way of accessing the data. InvenTree provides a "server" application out of the box, but this may not scale particularly well with multiple users. Instead, InvenTree can be served using a webserver such as [Gunicorn](https://gunicorn.org/). For more information see the [deployment documentation](start/deploy).
## Setup
To install a complete *development* environment for InvenTree, follow the steps presented below. A production environment will require further work as per the particular application requirements.
!!! warning "Windows"
If you are using the Windows operating system, it is recommended that you use the <a href='https://docs.microsoft.com/en-us/windows/wsl/install-win10'>WSL (Windows Subsystem for Linux) framework</a>
### Requirements
To install InvenTree you will need python3 (>3.6) installed, as well as PIP (the Python package manager).
Install these required programs (e.g. using apt or similar) before running the setup scripts.
For example:
```
sudo apt-get update
sudo apt-get install python3 python3-dev python3-pip
```
!!! warning "Sudo"
`apt-get` commands will (most likely) be required to run under sudo. Take care not to run the installation scripts under sudo, as this may alter the system python path and cause the InvenTree installation to not work correctly
### Python Virtual Environment
Installing the required Python packages inside a virtual environment allows a local install separate to the system-wide Python installation. While not strictly necessary, using a virtual environment is highly recommended as it prevents conflicts between the different Python installations.
You can read more about Python virtual environments [here](https://docs.python.org/3/tutorial/venv.html).
To configure Inventree inside a virtual environment, ``cd`` into the inventree base directory and run the following commands:
```
sudo apt-get install python3-venv
python3 -m venv inventree-env
source inventree-env/bin/activate
```
This will place the current shell session inside a virtual environment - the terminal should display the ``(inventree-env)`` prefix.
!!! warning "Activate virtual environment"
Remember to activate the virtual environment when starting each shell session, before running Inventree commands. This will ensure that the correct environment is being used.
### Invoke
InvenTree setup is performed using the [invoke](https://www.pyinvoke.org/) Python build tool. Various useful scripts are defined in the `tasks.py` file.
Install invoke as follows:
```
pip3 install invoke
```
To display a list of the available configuration scripts, run the following command:
```
invoke --list
```
## Download Source Code
Download the InvenTree source code to a local directory. It is recommended to perform this step using git, as this allows the InvenTree installation to be easily updated to the latest version.
```
git clone https://github.com/inventree/inventree/
```
Alternatively, the source can be downloaded as a [.zip archive](https://github.com/inventree/InvenTree/archive/master.zip).
Once the source is downloaded, cd into the source directory:
```
cd /path/to/inventree/
```
*(substitute /path/to/inventree/ with the directory where you have downloaded the source code)*.
## Installation
Now that the source code is downloaded (and optionally you have configured a Python virtual environment), the Python packages required to run InvenTree can be installed. InvenTree is a Python/Django application and relies on the pip package manager. All packages required to develop and test InvenTree are installed via pip. Package requirements can be found in ``requirements.txt``.
To setup the InvenTree environment, run the following commands (from the InvenTree source directory):
```
invoke install
```
This installs all required Python packages using pip package manager. It also creates a (default) database configuration file which needs to be edited to meet user needs before proceeding (see next step below).
Additionally, this step creates a *SECRET_KEY* file which is used for the django authentication framework.
!!! warning "Keep it secret, keep it safe"
The SECRET_KEY file should never be shared or made public.
### Database Configuration
Once the required packages are installed, the database configuration must be adjusted to suit your particular needs. InvenTree provides a simple default setup which should work *out of the box* for testing and debug purposes.
As part of the previous *install* step, a configuration file (**config.yaml**) is created. The configuration file provides administrators control over various setup options without digging into the Django *settings.py* script. The default setup uses a local sqlite database with *DEBUG* mode enabled.
For further information on installation configuration, refer to the [Configuration](start/config) section.
!!! warning "Configure Database"
Ensure database settings are correctly configured in `config.yaml` before proceeding to the next step!
### Initialize Database
Once install settings are correctly configured (in *config.yaml*) run the initial setup script:
```
invoke migrate
```
This performs the initial database migrations, creating the required tables, etc.
The database should now be installed!
### Create Admin Account
Create an initial superuser (administrator) account for the InvenTree instance:
```
invoke superuser
```
### Run Development Server
The InvenTree database is now setup and ready to run. A simple development server can be launched from the command line.
To launch the development server, run the following commands:
```
invoke server
```
For more server options, run:
```
invoke server -h
```
This will launch the InvenTree web interface at `http://127.0.0.1:8000`. For other options refer to the [django docs](https://docs.djangoproject.com/en/2.2/ref/django-admin/)
### Run Production Server
For a production install, refer to [deployment instructions](start/deploy).

40
docs/start/migrate.md Normal file
View File

@ -0,0 +1,40 @@
---
title: Migrating Data
layout: page
---
## 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.
!!! warning "Backup Database"
Ensure that the original database is securely backed up first!
### Export Data
```
python3 InvenTree/manage.py dumpdata --exclude contenttypes --exclude auth.permission --indent 2 > data.json
```
This will export all data (including user information) to a json data file.
### Initialize New Database
Configure the new database using the normal processes (see [Configuration](start/config))
Then, ensure that the database schema are correctly initialized in the new database:
```
python3 InvenTree/manage.py makemigrations
python3 InvenTree/manage.py migrate --run-syncdb
```
### Import Data
The new database should now be correctly initialized with the correct table structures requried to import the data. Run the following command to load the databased dump file into the new database.
```
python3 InvenTree/manage.py loaddata data.json
```
!!! info "Character Encoding"
If the character encoding of the data file does not exactly match the target database, the import operation may not succeed. In this case, some manual editing of the database JSON file may be required.

44
docs/start/update.md Normal file
View File

@ -0,0 +1,44 @@
---
title: Update InvenTree
layout: page
---
## Update InvenTree
Administrators wishing to update InvenTree to the latest version should follow the instructions below. The commands listed below should be run from the InvenTree root directory.
!!! info "Update Database"
It is advisable to backup the InvenTree database before performing these steps. The particular backup procedure may depend on your installation details.
### Stop InvenTree Server
Ensure the InvenTree server is stopped. This will depend on the particulars of your database installation.
### Update Source Code
Update the InvenTree source code to the latest version (or a particular commit if required).
For example, pull down the latest InvenTree sourcecode using Git:
```
git pull origin master
```
### Perform Database Migrations
Updating the database is as simple as calling the `update` script:
```
invoke update
```
This command performs the following steps:
* Ensure all rquired packages are installed and up to date
* Perform required database schema changes
* Run the user through any steps which require interaction
* Collect any new or updated static files
### Restart Server
Ensure the InvenTree server is restarted. This will depend on the particulars of your database installation.

40
docs/stock/adjust.md Normal file
View File

@ -0,0 +1,40 @@
---
title: Stock Adjustments
layout: page
---
## Stock Adjustments
InvenTree provides simple yet powerful management of stock levels. Multiple stock adjustment options are available, and each type of adjustment is automatically tracked to maintain a complete stock history.
### Move Stock
Multiple stock items can be moved to a new location in a single operation. Each item is moved to the selected location, and a stock tracking entry is added to the stock item history.
{% with id="stock_move", url="stock/stock_move.png", description="Stock movement" %}
{% include 'img.html' %}
{% endwith %}
### Add Stock
Add parts to a stock item record - for example putting parts back into stock. The in-stock quantity for each selected item is increased by the given amount.
{% with id="stock_add", url="stock/stock_add.png", description="Stock addition" %}
{% include 'img.html' %}
{% endwith %}
### Remove Stock
Remove parts from a stock item record - for example taking parts from stock for use. The in-stock quantity for each selected item is decreased by the given amount.
{% with id="stock_remove", url="stock/stock_remove.png", description="Stock removal" %}
{% include 'img.html' %}
{% endwith %}
### Count Stock
Count stock items (stocktake) to record the number of items in stock at a given point of time. The quantity for each part is pre-filled with the current quantity based on stock item history.
{% with id="stock_count", url="stock/stock_count.png", description="Stock count" %}
{% include 'img.html' %}
{% endwith %}

39
docs/stock/stock.md Normal file
View File

@ -0,0 +1,39 @@
---
title: Stock
layout: page
---
## Stock Location
A stock location represents a physical real-world location where *Stock Items* are stored. Locations are arranged in a cascading manner and each location may contain multiple sub-locations, or stock, or both.
## Stock Item
A *Stock Item* is an actual instance of a [*Part*](/part/part) item. It represents a physical quantity of the *Part* in a specific location.
### Stock Item Details
The *Stock Item* detail view shows information regarding the particular stock item:
**Part** - Which *Part* this stock item is an instance of
**Location** - Where is this stock item located?
**Quantity** - How many items are in stock?
**Supplier** - If this part was purcahsed from a *Supplier*, which *Supplier* did it come from?
**Supplier Part** - Link to the particular *Supplier Part*, if appropriate.
**Last Updated** - Date that the stock quantity was last updated
**Last Stocktake** - Date of most recent stocktake (count) of this item
**Status** - Status of this stock item
### Stock Tracking
Every time a *Stock Item* is adjusted, a *Stock Tracking* entry is automatically created. This ensures a complete history of the *Stock Item* is maintained as long as the item is in the system.
Each stock tracking historical item records the user who performed the action.

9
docs/stock/stocktake.md Normal file
View File

@ -0,0 +1,9 @@
---
title: Stocktake
layout: page
---
## Stocktake
!!! missing "TODO"
This section requires further work

51
docs/stock/test.md Normal file
View File

@ -0,0 +1,51 @@
---
title: Stock Test Result
layout: page
---
## Stock Test Result
Stock items which are associated with a *trackable* part can have associated test data - this is particularly useful for tracking unit testing / commissioning / acceptance data against a serialized stock item.
The master "Part" record for the stock item can define multiple [test templates](/part/test/), against which test data can be uploaded. Additionally, arbitrary test information can be assigned to the stock item.
!!! missing "TODO"
Include pictures of the Test Results tab
### Test Result Fields
#### Test Name
The name of the test data is used to associate the test with a test template object.
#### Result
Boolean pass/fail status of the test.
#### Value
Optional value uploaded as part of the test data. For example if the test is to record the firmware version of a programmed device, the version number can be added here.
#### Notes
Optional field available for extra notes.
#### Attachment
A given test result may require an attached file which contains extra test information.
### Multiple Test Results
Multiple results can be uploaded against the same test name. In cases where multiple test results are uploaded, the most recent value is used to determine the pass/fail status of the test. It is useful to keep all test records as a given test might be required to run multiple times, if (for example) it fails the first time and then something must be fixed before running the test again.
### Reporting
!!! missing "TODO"
Include information on the reporting plugin architecture
### Automated Test Intgration
The stock item testing framework is especially useful when integrating with an automated acceptance testing framework. Test results can be uploaded using the [InvenTree API](/extend/api/) or the [InvenTree Python Interface](/extend/python/).
!!! info "Example"
You design and sell a temperature sensor which needs to be calibrated before it can be sold. An automated calibration tool sets the offset in the device, and uploads a test result to the InvenTree database.

View File

@ -0,0 +1,47 @@
.overlay {
/* Display over the entire page */
position: fixed;
z-index: 99;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.9) !important;
/* Horizontal and vertical centering of the image */
display: flex;
align-items: center;
text-align: center;
/* We hide all this by default */
visibility: hidden;
/* Animation */
/* opacity: 0;*/
transition: opacity .3s;
}
.overlay img {
/* Maximum image size */
max-width: 90%;
max-height: 90%;
/* We keep the ratio of the image */
width: auto;
height: auto;
margin: auto;
/* Animation */
transform: scale(0.95);
transition: transform .3s;
}
.overlay:target {
visibility: visible;
outline: none;
cursor: default;
}
.overlay:target img {
transform: scale(1);
}

80
mkdocs.yml Normal file
View File

@ -0,0 +1,80 @@
# Project
repo_url: https://github.com/inventree/inventree-docs
repo_name: inventree/inventree-docs
site_name: InvenTree Documentation
site_description: InvenTree - Open Source Inventory Management
site_author: InvenTree
google_analytics: ['UA-143467500-1', 'inventree-docs']
# Theme
theme:
name: material
custom_dir: _includes/overrides
palette:
scheme: slate
logo: assets/logo.png
favicon: assets/favicon.ico
icon:
repo: fontawesome/brands/github
features:
- instant
- tabs
extra_css:
- stylesheets/extra.css
# Navigation
nav:
- Home: index.md
- Contribute: contribute.md
- Getting Started:
- Installation: start/install.md
- Configuration: start/config.md
- Deploying: start/deploy.md
- Updating: start/update.md
- Migrating: start/migrate.md
- Parts:
- Parts: part/part.md
- Part Views: part/views.md
- Parameters: part/parameter.md
- Template Parts: part/template.md
- Tests: part/test.md
- Stock:
- Stock Items: stock/stock.md
- Adjusting Stock: stock/adjust.md
- Stocktake: stock/stocktake.md
- Test Results: stock/test.md
- Build:
- Build Parts: build/build.md
- BOM: build/bom.md
- Buy:
- Suppliers: buy/supplier.md
- Purchase Orders: buy/po.md
- Report:
- Labels: report/labels.md
- Templates: report/report.md
- Test Reports: report/test.md
- Packing List: report/pack.md
- Order: report/order.md
- Admin:
- Admin Interface: admin/admin.md
- Export Data: admin/export.md
- Import Data: admin/import.md
- Extend:
- API: extend/api.md
- Python Interface: extend/python.md
- Plugins: extend/plugins.md
- Third-Party: extend/integrate.md
# Plugins
plugins:
- search
- macros:
include_dir: _includes
# Extensions
markdown_extensions:
- admonition
- pymdownx.details
- markdown.extensions.codehilite
- toc:
permalink:

24
requirements.txt Normal file
View File

@ -0,0 +1,24 @@
click==7.1.2
future==0.18.2
Jinja2==2.11.2
joblib==0.16.0
livereload==2.6.3
lunr==0.5.8
Markdown==3.2.2
MarkupSafe==1.1.1
mkdocs==1.1.2
mkdocs-macros-plugin==0.4.9
mkdocs-material==5.5.12
mkdocs-material-extensions==1.0
nltk==3.5
pip-autoremove==0.9.1
Pygments==2.7.1
pymdown-extensions==8.0
python-dateutil==2.8.1
PyYAML==5.3.1
regex==2020.7.14
repackage==0.7.3
six==1.15.0
termcolor==1.1.0
tornado==6.0.4
tqdm==4.49.0