diff --git a/docs/admin/import.md b/docs/admin/import.md index f6d801a..9170617 100644 --- a/docs/admin/import.md +++ b/docs/admin/import.md @@ -4,5 +4,88 @@ title: Importing Data ## Importing Data -!!! missing "TODO" - This section requires further work +External data can be imported via the admin interface, allowing for rapid integration of existing datasets, or bulk editing of table data. + +!!! danger "Danger" + Uploading bulk data directly is a non-reversible action. + +!!! warning "Backup" + Ensure you have made a backup of your database before performing bulk data import. + +!!! warning "Supported Models" + Not all models in the InvenTree database support bulk import actions. + +When viewing a model (which supports bulk data import) in the admin interface, select the "Import" button in the top-right corner: + +{% with id="import", url="admin/import.png", description="Data import" %} +{% include 'img.html' %} +{% endwith %} + +The next screen displays a list of column headings which are expected to be present in the uploaded data file. + +{% with id="import_upload", url="admin/import_upload.png", description="Data upload" %} +{% include 'img.html' %} +{% endwith %} + +Select the data file to import, and the data format. Press the "Submit" button to upload the file. + +### File Format + +The uploaded data file must meet a number of formatting requirements for successful data upload. A simple way of ensuring that the file format is correct is to first [export data](../export) for the model in question, and delete all data rows (not the header row) from the exported data file. + +Then, the same file can be used as a template for uploading more data to the server. + +### ID Field + +The uploaded data file requires a special field called `id`. This `id` field uniquely identifies each entry in the database table(s) - it is also known as a *primary key*. + +The `id` column **must** be present in an uploaded data file, as it is required to know how to process the incoming data. + +Depending on the value of the `id` field in each row, InvenTree will attempt to either insert a new record into the database, or update an existing one. + +#### Empty ID + +If the `id` field in a given data row is empty (blank), then InvenTree interprets that particular row as a *new* entry which will be inserted into the database. + +If you wish for a new database entry to be created for a particular data row, the `id` field **must** be left blank for that row. + +#### Non-Empty ID + +If the `id` field in a given data row is *not* empty, then InvenTree inteprets that particular row as an *existing* row to override / update. + +In this case, InvenTree will search the database for an entry with the matching `id`. If a matching entry is found, then the entry is updated with the provided data. + +However, if an entry is *not* found with the matching `id`, InvenTree will return an error message, as it cannot find the matching database entry to update. + +!!! warning "Check id Value" + Exercise caution when uploading data with the `id` field specified! + +### Import Preview + +After the data file has been uploaded and validated, the user is presented with a *preview* screen, showing the records that will be inserted or updated in the database. + +Here the user has a final chance to review the data upload. + +Press the *Confirm Import* button to actually perform the import process and commit the data into the database. + +{% with id="import_preview", url="admin/import_preview.png", description="Data upload preview" %} +{% include 'img.html' %} +{% endwith %} + +Note that *new* records are automatically assigned an `id` value. + +## Import Errors + +Manually importing data in a relational database is a complex process. You may be presented with an error message which describes why the data could not be imported. + +The error message should contain enough information to manually edit the data file to fix the problem. + +Any error messages are displayed per row, and you can hover the mouse over the particular error message to view specific error details: + +{% with id="import_error", url="admin/import_error.png", description="Data upload error" %} +{% include 'img.html' %} +{% endwith %} + + +!!! info "Report Issue" + If the error message does not provide enough information, or the error seems like a bug caused by InvenTree itself, report an [issue on Github](https://github.com/inventree/inventree/issues). \ No newline at end of file diff --git a/docs/app/app.md b/docs/app/app.md index c5013f4..90f7f4c 100644 --- a/docs/app/app.md +++ b/docs/app/app.md @@ -4,5 +4,43 @@ title: InvenTree Mobile App ## InvenTree Mobile App -!!! note "Work In Progress" - InvenTree app documentation will be available soon. \ No newline at end of file +The InvenTree Mobile App brings stock control to your pocket. Integrating seamlessly with the [InvenTree API](../../extend/api), the app provides immediate access to inventory data without requiring physical access to a computer. + +Native barcode support provides a multitude of context-sensitive stock control actions, allowing streamlined inventory management at your fingertips. + +## Download + +### Android + +The InvenTree App can be downloaded for Android devices via the [Play Store](https://play.google.com/store/apps/details?id=inventree.inventree_app). + +### iOS + +!!! missing "Not Yet Available" + The InvenTree app is not yet available for iOS devices + +## Connect to InvenTree + +Use of the InvenTree app assumes that you (the user) have access to an InvenTree server. + +!!! success "Profiles" + The app supports multiple user profiles, providing simple switching between different InvenTree servers and/or account profiles. + +!!! todo "Add Screenshot" + Add screenshot of "Profiles" screen + +!!! todo "Add Screenshot" + Add screenshot of "connection failed" screen + +!!! todo "Add Screenshot" + Add screenshow of "connection success" screen + +## Index Page + +!!! todo "TODO" + This section requires further work + +## Menu Bar + +!!! todo "TODO" + This section requires further work diff --git a/docs/app/barcode.md b/docs/app/barcode.md new file mode 100644 index 0000000..d6996c2 --- /dev/null +++ b/docs/app/barcode.md @@ -0,0 +1,31 @@ +--- +title: App Barcode Support +--- + +## Barcode Support + +One of the key elements of functionality provided by the InvenTree app is the native support for context-sensitive barcode scanning. + +Barcode integration allows extremely efficient stock control, for information lookup and also performing various actions. + +### Supported Codes + +The following code types are known to be supported + +**1D Codes** + +- Code-39 +- Code-93 +- Code-128 +- ITF + +**2D Codes** + +- QR Code +- Data Matrix +- Aztec + +## Actions + +!!! todo "TODO" + This section requires further work \ No newline at end of file diff --git a/docs/app/issues.md b/docs/app/issues.md new file mode 100644 index 0000000..e50fbf3 --- /dev/null +++ b/docs/app/issues.md @@ -0,0 +1,13 @@ +--- +title: App Suggestions / Issues +--- + +## Suggestions / Issues + +To suggest an improvement or new feature for the InvenTree app, or to report an issue, refer to the [InvenTree GitHub page](https://github.com/inventree/inventree/issues). + +Suggestions or issues related to the InvenTree app will be tagged with the `app` label, and can be viewed here: + +[https://github.com/inventree/InvenTree/issues?q=is:open+is:issue+label:app](https://github.com/inventree/InvenTree/issues?q=is%3Aopen+is%3Aissue+label%3Aapp) + +General feedback on the app is also welcomed - if you have any ideas on how to make the app more functional or effective, please let us know! \ No newline at end of file diff --git a/docs/app/part.md b/docs/app/part.md new file mode 100644 index 0000000..67a7c67 --- /dev/null +++ b/docs/app/part.md @@ -0,0 +1,38 @@ +--- +title: Part Views +--- + +## InvenTree App Part Views + +!!! todo "TODO" + This section requires further work + +## Part + +!!! todo "TODO" + This section requires further work + +### Details + +!!! todo "TODO" + This section requires further work + +### Stock + +!!! todo "TODO" + This section requires further work + +## Part Category + +!!! todo "TODO" + This section requires further work + +### Details + +!!! todo "TODO" + This section requires further work + +### Parts + +!!! todo "TODO" + This section requires further work \ No newline at end of file diff --git a/docs/app/privacy.md b/docs/app/privacy.md index 3048f79..07a6617 100644 --- a/docs/app/privacy.md +++ b/docs/app/privacy.md @@ -31,17 +31,6 @@ Pictures taken in the InvenTree app are not stored or distributed to any other s The InvenTree app does not collect any information which could be used to personally identify the user(s) of the device onto which the app is installed. -## Error Reporting - -Error and crash reporting is handled using the [sentry.io](https://sentry.io) service. When an unexpected error occurs, the user is presented with an option to automatically upload an error report. This is to assist with improving the code quality of the InvenTree app. - -In addition to the specific details of the error (stack trace data), the following context data are included in the error report: - -- **Phone Model** - Information on particular phone model -- **App Version** - App version information - -Note: No personally identifiable information is included in the error report upload. - ## Third Party Access -Aside from error reporting using the sentry reporting service, the InvenTree app does not share any information with third parties. +The InvenTree app does not share any information with third parties. diff --git a/docs/app/stock.md b/docs/app/stock.md new file mode 100644 index 0000000..d49f7a9 --- /dev/null +++ b/docs/app/stock.md @@ -0,0 +1,22 @@ +--- +title: Stock Views +--- + +## InvenTree App Stock Views + +!!! todo "TODO" + This section requires further work + +## Stock Item + +### Details + +### Actions + +## Stock Location + +### Details + +### Actions + +## Search \ No newline at end of file diff --git a/docs/app/translation.md b/docs/app/translation.md new file mode 100644 index 0000000..8b8c628 --- /dev/null +++ b/docs/app/translation.md @@ -0,0 +1,17 @@ +--- +title: App Translations +--- + +## Translation Support + +The InvenTree app, much like the InvenTree web-based application, is designed to support multiple language translations. + +As with the web application, translations are community contributed - if the app does not support your native language, contributions are very welcome! + +## Contributing + +Translation files for the InvenTree app are [available on GitHub](https://github.com/inventree/inventree-app-i18n/). + +A Python helper script simplifies the translation process by presenting the user with words or phrases which require translation, one item at a time. + +Full translation efforts, while appreciated, are not required. Please feel free to contribute as much as you can! \ No newline at end of file diff --git a/docs/assets/images/admin/import.png b/docs/assets/images/admin/import.png new file mode 100644 index 0000000..74901c3 Binary files /dev/null and b/docs/assets/images/admin/import.png differ diff --git a/docs/assets/images/admin/import_error.png b/docs/assets/images/admin/import_error.png new file mode 100644 index 0000000..8c83a53 Binary files /dev/null and b/docs/assets/images/admin/import_error.png differ diff --git a/docs/assets/images/admin/import_preview.png b/docs/assets/images/admin/import_preview.png new file mode 100644 index 0000000..dfa7b6c Binary files /dev/null and b/docs/assets/images/admin/import_preview.png differ diff --git a/docs/assets/images/admin/import_upload.png b/docs/assets/images/admin/import_upload.png new file mode 100644 index 0000000..1f93b67 Binary files /dev/null and b/docs/assets/images/admin/import_upload.png differ diff --git a/docs/assets/images/build/inherited_bom.drawio b/docs/assets/images/build/inherited_bom.drawio new file mode 100644 index 0000000..2163b94 --- /dev/null +++ b/docs/assets/images/build/inherited_bom.drawio @@ -0,0 +1 @@ +7Vpbb5swFP41SNvDJrCB0MeGdFukVevUqVufJhc7gQ5w5Di3/vqZYK4mlFYk7BKpUvHx/fs++5zjVoNutP3I0MK/ppiEGtDxVoMTDQDDBEBLfnS8Sy0jy0wNcxZg2agw3AZPRBp1aV0FmCwrDTmlIQ8WVaNH45h4vGJDjNFNtdmMhtVZF2hOFMOth0LV+j3A3E+tjqUX9k8kmPvZzIYuayKUNZaGpY8w3ZRM8EqDLqOUp1/R1iVhAl6GS9rvw4HafGGMxLxLh/vHn77r2uPp56/R4+Qp8qZw/U6OskbhSm74G4kWIeJEWG8Q4+LXpVw/32WgMLqKMUnGNTQ43vgBJ7cL5CW1GyEDYfN5FMpqOQNhnGwPLt3IARFKIjQinO1EE9kBOhJDKaKsuCkYMTKY/RIbtrQhKYJ5PnKBk/iQUL0ANqDApgE7FLOOcbAWn/Pk8w6xAMUJguOsVkxWajA4rqCGK9CHBhYqwBYouoPjZf5xeJkteE0Gx6uuLwiGxstuOLg1kEiMLxPHIUpeiJbLwKviQrYB/yG+9ffAksX7UtUk2bueFXZZIRarT3tZWfG+XFd025eyfunqCFacVI0CsQO6Yh55/qrniM0Jf+5uUyktUWY1MJbZGBHOI1hXl9tEo5zhhgZ7sWYnTK8qxoQ1JaTblL3K3q4+kFWTnlMbKMVBGWivqnzbrxfaqE+hjf5JocGz0HoQmtOn0LrrrEe9gI56Mc966UEvF4pexl+uhWHKSZQE+wIZ/c009gkT0QF+2xJD6M/HELMgDF0aUrbvCzEiziwR35Iz+ouUamzPIQ+zfqIOC1QRbsoW7AalgGMFHVku254uVGnIWzywIl14YRLRgaAjwG0YHYO84+GtZrUNeOcaTxK0+hHoH+lBjkLORVsA3nRrHo+bJn915kY7kEyelhvVN/yn3Ni1Ow003Wkn5QZ0utMqfIwVV34Kj1LnyyIONpv4csADtO0jnSU4OF/gzNcL/JI1OF9tL49XLRAP85JmmkO/pAH16VFBacjEc6hEEcILsZvWDK9rqqgOldN+omQRWOeIoPnGajyAp72xmt6yzx7mEF+jwflqehJu58s1TsNQD3grEXNXB3U8vDtlmhW8J38P3oZZi6C6/k38FXiLYvFvCqlrKf7ZA179Bg== \ No newline at end of file diff --git a/docs/assets/images/build/inherited_bom.png b/docs/assets/images/build/inherited_bom.png new file mode 100644 index 0000000..95475a3 Binary files /dev/null and b/docs/assets/images/build/inherited_bom.png differ diff --git a/docs/build/bom.md b/docs/build/bom.md index e6cab55..260ff45 100644 --- a/docs/build/bom.md +++ b/docs/build/bom.md @@ -6,6 +6,76 @@ title: Bill of Materials A Bill of Materials (BOM) defines the list of component parts required to make an assembly, [create builds](../build) and allocate inventory. +A part which can be built from other sub components is called an *Assembly*. + +## BOM Line Items + +A BOM for a particular assembly is comprised of a number (zero or more) of BOM "Line Items", each of which has the following properties: + +| Property | Description | +| --- | --- | +| Part | A reference to another *Part* object which is required to build this assembly | +| Quantity | The quantity of *Part* required for the assembly | +| Reference | Optional reference field to describe the BOM Line Item, e.g. part designator | +| Overage | Estimated losses for a build. Can be expressed as absolute values (e.g. 1, 7, etc) or as a percentage (e.g. 2%) | +| Inherited | A boolean field which indicates whether this BOM Line Item will be "inherited" by BOMs for parts which are a variant (or sub-variant) of the part for which this BOM is defined. | +| Optional | A boolean field which indicates if this BOM Line Item is "optional" | +| Note | Optional note field for additional information + +!!! missing "Overage" + While the overage field exists, it is currently non-functional and has no effect on BOM operation + +!!! missing "Optional" + The Optional field is currently for indication only - it does not serve a functional purpose (yet) + +### Inherited BOM Line Items + +When using the InvenTree [template / variant](../../part/template) feature, it may be useful to make use of the *inheritance* capability of BOM Line Items. + +If a BOM Line Item is designed as *Inherited*, it will be automatically included in the BOM of any part which is a variant (or sub-variant) of the part for which the BOM Line Item is defined. + +This is particulary useful if a template part is defined with the "common" BOM items which exist for all variants of that template. + +Consider the example diagram below: + +{% with id="inherited_bom", url="build/inherited_bom.png", description="Inherited BOM Line Items" %} +{% include 'img.html' %} +{% endwith %} + +**Template Part A** has two BOM line items defined: *A1* and *A2*. + +- *A1* is inherited by all variant parts underneath *Template Part A* +- *A2* is not inherited, and is only included in the BOM for *Template Part A* + +**Variant B** has two line items: + +- *A1* is inherited from parent part *A* +- *B1* is defined for part *B* (and is also defined as an inherited BOM Line Item) + +**Variant C** + +- *A1* inherited from *A* +- *C1* defined for *C* + +**Variant D** + +- *A1* inherited from *A* +- *B1* inherited from *B* +- *D1* defined for *D* + +**Variant E** + +- Well, you get the idea. + +Note that inherited BOM Line Items only flow "downwards" in the variant inheritance chain. Parts which are higher up the variant chain cannot inherit BOM items from child parts. + +!!! info "Editing Inherited Items" + When editing an inherited BOM Line Item for a template part, the changes are automatically reflected in the BOM of any variant parts. + +## BOM Creation + +BOMs can be created manually, by adjusting individual line items, or by upload an existing BOM file. + ### Add BOM Item To manually add a BOM item, navigate to the part/assembly detail page then click on the "BOM" tab. On top of the tab view, click on the icon then, after the page reloads, click on the icon. diff --git a/docs/extend/future.md b/docs/extend/future.md deleted file mode 100644 index d976945..0000000 --- a/docs/extend/future.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: Future Features ---- - -## Future Features - -An non-exhaustive list of feature proposals from InvenTree users. - -!!! warning "Disclaimer" - **There is no guarantee that any of those feature will be integrated into InvenTree.** - If you would like to see them implemented, make your voice heard :) - -### General - -| Feature | Link(s) | -| ----------- | ----------- | -| Barcodes / QR Codes | [#853](https://github.com/inventree/InvenTree/issues/853) [#708](https://github.com/inventree/InvenTree/issues/708) [#677](https://github.com/inventree/InvenTree/issues/677) | -| History tracking | [#547](https://github.com/inventree/InvenTree/issues/547) [#537](https://github.com/inventree/InvenTree/issues/537) [#377](https://github.com/inventree/InvenTree/issues/377) | -| "Copy to clipboard" function | [#997](https://github.com/inventree/InvenTree/issues/997) [#725](https://github.com/inventree/InvenTree/issues/725) | -| "Comments" support | [#868](https://github.com/inventree/InvenTree/issues/868) | - -### Part - -| Feature | Link(s) | -| ----------- | ----------- | -| Part Ownership and Lending | [#656](https://github.com/inventree/InvenTree/issues/656) | - -### Build - -| Feature | Link(s) | -| ----------- | ----------- | -| Add ability to modify a completed build | [#977](https://github.com/inventree/InvenTree/issues/977) | -| Partial build completion | [#572](https://github.com/inventree/InvenTree/issues/572) | - -### Orders - -| Feature | Link(s) | -| ----------- | ----------- | -| Receiving order and allocating | [#551](https://github.com/inventree/InvenTree/issues/551) | \ No newline at end of file diff --git a/docs/part/part.md b/docs/part/part.md index f5d9c46..719a818 100644 --- a/docs/part/part.md +++ b/docs/part/part.md @@ -51,7 +51,7 @@ If a part is designated as a *Component* it can be used as a sub-component of an Trackable parts can be assigned batch numbers or serial numbers which uniquely identify a particular stock item. Trackable parts also provide other features (and restrictions) in the InvenTree ecosystem. -[Read further information about trackable parts here](/../trackable). +[Read further information about trackable parts here](../trackable). ### Purchaseable @@ -63,4 +63,4 @@ If a part is designated as *Salable* it can be sold to external customers. Setti ### 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. \ No newline at end of file +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. diff --git a/docs/releases/0.1.4.md b/docs/releases/0.1.4.md index 6ab4105..cb8237d 100644 --- a/docs/releases/0.1.4.md +++ b/docs/releases/0.1.4.md @@ -1,5 +1,5 @@ --- -title: v0.1.4 +title: Release 0.1.4 --- ## Release 0.1.4 diff --git a/docs/releases/0.1.5.md b/docs/releases/0.1.5.md index f6afc7a..dfede93 100644 --- a/docs/releases/0.1.5.md +++ b/docs/releases/0.1.5.md @@ -1,5 +1,5 @@ --- -title: v0.1.5 +title: Release 0.1.5 --- ## Release 0.1.5 diff --git a/docs/releases/0.1.6.md b/docs/releases/0.1.6.md index 72b83df..85f95b1 100644 --- a/docs/releases/0.1.6.md +++ b/docs/releases/0.1.6.md @@ -1,10 +1,10 @@ --- -title: v0.1.5 +title: Release 0.1.6 --- ## Release 0.1.6 -[Release 0.1.5](https://github.com/inventree/InvenTree/releases/tag/0.1.5) (Febuary 2021) provides a number of major new features and improvements, as well as some crucial bug fixes: +[Release 0.1.6](https://github.com/inventree/InvenTree/releases/tag/0.1.6) (Febuary 2021) provides a number of major new features and improvements, as well as some crucial bug fixes: ## New Features @@ -24,6 +24,22 @@ Refer to the [report documentation](../../report/report) for further information !!! warning "LaTeX Support" LaTeX report templates are no longer supported for a number of technical and ideological reasons +[#1292](https://github.com/inventree/InvenTree/pull/1292) adds support for build order / work order reports. Refer to the [build report documentation](../../report/build) for further information. + +### Inherited BOM Items + +[#1313](https://github.com/inventree/InvenTree/pull/1313) adds support for inherited BOM items, allowing greater flexibility for Bill of Materials management when combined with the Template / Variant part system. + +Refer to the [BOM documentation](../../build/bom) for further information. + +### Stock Item Packaging + +[#1329](https://github.com/inventree/InvenTree/pull/1329) adds a *packaging* field to the StockItem model, so the particular packaging information (e.g. tape / reel / loose / etc) can be captured per stock item. + +### Visual Improvements + +[#1333](https://github.com/inventree/InvenTree/pull/1333) provides a significant overhaul of the visual style of the "index" and "search" pages. + ## Major Bug Fixes | PR | Description | | --- | --- | @@ -33,3 +49,4 @@ Refer to the [report documentation](../../report/report) for further information | [#1289](https://github.com/inventree/InvenTree/pull/1289) | Fixes display bug when a part "units" field is empty | | [#1290](https://github.com/inventree/InvenTree/pull/1290) | Fixes CSS issues with long error messages in modal forms | | [#1294](https://github.com/inventree/InvenTree/pull/1294) | Allows access to static files without being logged in | +| [#1320](https://github.com/inventree/InvenTree/pull/1320) | Fixes "Used In" display for parts that are referenced in inerited BOMs | diff --git a/docs/releases/0.1.7.md b/docs/releases/0.1.7.md new file mode 100644 index 0000000..022b5f2 --- /dev/null +++ b/docs/releases/0.1.7.md @@ -0,0 +1,23 @@ +--- +title: Release 0.1.7 +--- + +## Release 0.1.7 + +[Release 0.1.7](https://github.com/inventree/InvenTree/releases/tag/0.1.7) (WIP) provides a number of major new features and improvements, as well as some crucial bug fixes: + +## New Features + +### Label Printing + +Label printing functionality has been simplified and brought into line with the PDF reporting functionality. + +[#1342](https://github.com/inventree/InvenTree/pull/1342) represents a significant refactor of the label printing code. + +!!! info "More Information" + Refer to the [label printing documentation](../../report/labels) for further details. + +## Major Bug Fixes +| PR | Description | +| --- | --- | +| [#1341](https://github.com/inventree/InvenTree/pull/1341) | Fixes display issue with Part variant table | diff --git a/docs/releases/new.md b/docs/releases/new.md index f0ad20e..8d26f8f 100644 --- a/docs/releases/new.md +++ b/docs/releases/new.md @@ -8,6 +8,16 @@ For information on the latest and greatest InvenTree features, refer to the rele | Release | Date | | ------- | ---- | -| 0.1.6 | *In Development* | +| [0.1.7](../0.1.7) | *In Development* | +| [0.1.6](../0.1.6) | February 2021 | | [0.1.5](../0.1.5) | January 2021 | | [0.1.4](../0.1.4) | November 2020 | + +## Upcoming Features + +In-progress and upcoming features can be viewed on [GitHub](https://github.com/inventree/inventree/pulls), where the InvenTree source code is hosted. + +## Suggest Something New + +To suggest a new feature (or report a bug) raise an [issue on GitHub](https://github.com/inventree/inventree/issues). + diff --git a/docs/report/barcodes.md b/docs/report/barcodes.md new file mode 100644 index 0000000..8726c71 --- /dev/null +++ b/docs/report/barcodes.md @@ -0,0 +1,64 @@ +--- +title: Barcode Generation +--- + +## Barcode Generation + +Both [report](../report) and [label](../labels) templates can render custom barcode data to in-line images. + +!!! info "img" + Barcode data must be rendered inside an `` tag. + +Inside the template file (whether it be for printing a label or generating a custom report), the following code will need to be included at the top of the template file: + +```html +{% raw %} + +{% load barcode %} +{% endraw %} +``` + +### 1D Barcode + +!!! info "python-barcode" + One dimensional barcodes (e.g. Code128) are generated using the [python-barcode](https://pypi.org/project/python-barcode/) library. + +To render a 1D barcode, use the `barcode` template tag, as shown in the example below: + +```html +{% raw %} + + +{% load barcode %} + + + +{% endraw %} +``` + +The default barcode renderer will generate a barcode using [Code128](https://en.wikipedia.org/wiki/Code_128) rendering. However [other barcode formats](https://python-barcode.readthedocs.io/en/stable/codes.html) are also supported: + +```html +{% raw %} + +{% load barcode %} + + +{% endraw %} +``` diff --git a/docs/report/build.md b/docs/report/build.md new file mode 100644 index 0000000..6850b00 --- /dev/null +++ b/docs/report/build.md @@ -0,0 +1,24 @@ +--- +title: Build Order Report +--- + +## Build Order Report + +Custom build order reports may be generated against any given Build Order. For example, build order reports can be used to generate work orders. + +### Build Filters + +!!! missing "TODO" + This section rquires further work + +### Context Variables + +In addition to the default report context variables, the following context variables are made available to the build order report template for rendering: + +| Variable | Description | +| --- | --- | +| build | The build object the report is being generated against | +| part | The part object that the build references | +| reference | The build order reference string | +| quantity | Build order quantity | + diff --git a/docs/report/labels.md b/docs/report/labels.md index a80f1cc..c9fd87e 100644 --- a/docs/report/labels.md +++ b/docs/report/labels.md @@ -4,18 +4,16 @@ title: Custom Labels ## Custom Labels -InvenTree supports printing of custom template-based labels, using the [blabel](https://github.com/Edinburgh-Genome-Foundry/blabel) Python library. +InvenTree supports printing of custom template-based labels, using the [WeasyPrint](https://weasyprint.org/) PDF generation engine. 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](https://edinburgh-genome-foundry.github.io/blabel/) for further information, and examples of the available features Simple (generic) label templates are supplied 'out of the box' with InvenTree - however support is provided for generation of extremely specific custom labels, to meet any particular requirement. ## Label Templates -Label templates are written using a mixture of [HTML](https://www.w3schools.com/html/) and [CSS](https://www.w3schools.com/css). The blabel library is based on [weasyprint](https://weasyprint.org/), which supports a *subset* of HTML and CSS features. In addition to supporting HTML and CSS formatting, the label templates support the Jinja templating engine, allowing conditional formatting of the label data. +Label templates are written using a mixture of [HTML](https://www.w3schools.com/html/) and [CSS](https://www.w3schools.com/css). [Weasyprint](https://weasyprint.org/) templates support a *subset* of HTML and CSS features. In addition to supporting HTML and CSS formatting, the label templates support the Jinja templating engine, allowing conditional formatting of the label data. A label template is a single `.html` file which is uploaded to the InvenTree server by the user. @@ -29,8 +27,7 @@ Below is a reasonably simple example of a label template which demostrates much {% raw %} - +
{{ location.name }} @@ -99,11 +96,9 @@ Location Name: {{ location.name }} {% endraw %} ``` -### QR Codes +### Barcodes -`blabel` supports barcodes and QR codes 'out of the box'. Passing data to render as a barcode or QR code is handled in the template file itself. - -Refer to the [blabel docs](https://edinburgh-genome-foundry.github.io/blabel/) for further information. +Refer to the [barcode documentation](../barcodes). ### Conditional Formatting @@ -127,10 +122,67 @@ As an example, consider a label template for a StockItem. A user may wish to def To restrict the label accordingly, we could set the *filters* value to `part__IPN=IPN123`. -### Built-In Templates +## Built-In Templates The InvenTree installation provides a number of simple *default* templates which can be used as a starting point for creating custom labels. These built-in templates can be disabled if they are not required. +Built-in templates can also be used to quickly scaffold custom labels, using template inheritance. + +### Base Template + +For example, InvenTree provides a *base* template from which all of the default label templates are derived. This *base* template provides the essentials for generating a label: + +```html +{% raw %} + + + + + + {% block content %} + + {% endblock %} + + +{% endraw %} +``` + +### Extend Base Template + +To extend this template in a custom uploaded label, simply extend as follows: + +```html +{% raw %} +{% extends "label/label_base.html" %} + +{% block style %} + +{% endblock %} + +{% block content %} + +{% endblock %} + +{% endraw %} +``` + + ## Stock Item Labels Stock Item label templates are used to generate labels for individual Stock Items. diff --git a/docs/report/report.md b/docs/report/report.md index fca460f..4d93ad2 100644 --- a/docs/report/report.md +++ b/docs/report/report.md @@ -48,6 +48,24 @@ For example, rendering the name of a part (which is available in the particular !!! 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. +### Context Data + +Each report has access to a number of context variables by default. The following context variables are provided to every report template: + +| Variable | Description | +| --- | --- | +| date | Current date, represented as a Python datetime.date object | +| datetime | Current datetime, represented as a Python datetime object | +| default_page_size | InvenTree default page size variable | +| report_name | Name of the report template | +| report_description | Description of the report template | +| report_revision | Revision of the report template | +| request | Django request object | +| user | User who made the request to render the template | + +!!! info "Specific Report Context" + Specific report types may have additional context variables + ### Conditional Rendering The django template system allows for conditional rendering, providing conditional flow statements such as `{% raw %}{% if %}{% endraw %}`, `{% raw %}{% for in %}{% endraw %}`, etc. @@ -182,7 +200,7 @@ InvenTree supports the following reporting functionality: ### Build Report -Build Report: TODO +[Build Order](../build): Format a build order report ### Purchase Order [Purchase Order report](../order): Order line items diff --git a/docs/report/test.md b/docs/report/test.md index d901081..5b5a162 100644 --- a/docs/report/test.md +++ b/docs/report/test.md @@ -27,12 +27,14 @@ In the example below, a test report template is uploaded and assigned to the par ### Context Variables -The following context variables are made available to the TestReport template for rendering: +In addition to the default report 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 +| Variable | Description | +| --- | --- | +| 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 diff --git a/docs/start/config.md b/docs/start/config.md index 6df457a..b997061 100644 --- a/docs/start/config.md +++ b/docs/start/config.md @@ -132,7 +132,7 @@ For further information, refer to the following documentation: ### Static File Storage -By default, static files are stored in the local directory `./inventree_media`. This directory should be changed by specifying the `static_root` option in the config file based on the particular installation requirements. +By default, static files are stored in the local directory `./inventree_static`. This directory should be changed by specifying the `static_root` option in the config file based on the particular installation requirements. Alternatively this location can be specified with the `INVENTREE_STATIC_ROOT` environment variable. diff --git a/mkdocs.yml b/mkdocs.yml index 22f5428..619d88d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -71,11 +71,13 @@ nav: - Sales Orders: companies/so.md - Report: - Templates: report/report.md + - Labels: report/labels.md - Reports: - Test Reports: report/test.md - Packing List: report/pack.md + - Build Order: report/build.md - Order: report/order.md - - Labels: report/labels.md + - Barcodes: report/barcodes.md - Admin: - Admin Interface: admin/admin.md - User Permissions: admin/permissions.md @@ -89,10 +91,14 @@ nav: - Plugins: extend/plugins.md - Themes: extend/themes.md - Third-Party: extend/integrate.md - - Future Features: extend/future.md - App: - - App: app/app.md + - InvenTree App: app/app.md + - Barcodes: app/barcode.md + - Parts: app/part.md + - Stock: app/barcode.md - Privacy: app/privacy.md + - Translation: app/translation.md + - Suggestions: app/issues.md # Plugins plugins: