diff --git a/docs/docs/extend/plugins/barcode.md b/docs/docs/extend/plugins/barcode.md index 6e7b16d055..864afec342 100644 --- a/docs/docs/extend/plugins/barcode.md +++ b/docs/docs/extend/plugins/barcode.md @@ -23,3 +23,35 @@ POST { barcode_data: "[(>someBarcodeDataWhichThePluginKnowsHowToDealWith" } ``` + +### Example +Please find below a very simple example that is executed each time a barcode is scanned. + +```python +from django.utils.translation import gettext_lazy as _ + +from InvenTree.models import InvenTreeBarcodeMixin +from plugin import InvenTreePlugin +from plugin.mixins import BarcodeMixin + +class InvenTreeBarcodePlugin(BarcodeMixin, InvenTreePlugin): + + NAME = "MyBarcode" + TITLE = "My Barcodes" + DESCRIPTION = "support for barcodes" + VERSION = "0.0.1" + AUTHOR = "Michael" + + status = 0 + + def scan(self, barcode_data): + + self.status = self.status+1 + print('Started barcode plugin', self.status) + print(barcode_data) + response = {} + return response + +``` + +To try it just copy the file to src/InvenTree/plugins and restart the server. Open the scan barcode window and start to scan codes or type in text manually. Each time the timeout is hit the plugin will execute and printout the result. The timeout can be changed in settings->Barcode Support->Barcode Input Delay. diff --git a/docs/docs/report/report.md b/docs/docs/report/report.md index 2554c0983b..e0ff863546 100644 --- a/docs/docs/report/report.md +++ b/docs/docs/report/report.md @@ -148,6 +148,7 @@ InvenTree supports the following reporting functionality: | [Purchase Order Report](./purchase_order.md) | Format a purchase order report | | [Sales Order Report](./sales_order.md) | Format a sales order report | | [Return Order Report](./return_order.md) | Format a return order report | +| [Stock Location Report](./stock_location.md) | Format a stock location report | ### Default Reports diff --git a/docs/docs/report/stock_location.md b/docs/docs/report/stock_location.md new file mode 100644 index 0000000000..cfe252b274 --- /dev/null +++ b/docs/docs/report/stock_location.md @@ -0,0 +1,16 @@ +--- +title: Stock Location Reports +--- + +## Stock location Reports + +You can print a formatted report of a stock location. This makes sense if you have several parts inside one location, e.g. a box that is sent out to a manufacturing partner. Whit a report you can create a box content list. + +### Context Variables +You can use all content variables from the [StockLocation](./context_variables.md#stocklocation) object. + +### Default Report Template + +A default report template is provided out of the box, which can be used as a starting point for developing custom return order report templates. + +View the [source code](https://github.com/inventree/InvenTree/blob/master/InvenTree/report/templates/report/inventree_slr_report.html) for the default stock location report template. diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 2776a3c780..1155b9dfa4 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -140,6 +140,7 @@ nav: - Sales Order: report/sales_order.md - Return Order: report/return_order.md - BOM: report/bom.md + - Stock Location: report/stock_location.md - Labels: - Custom Labels: report/labels.md - Part Labels: report/labels/part_labels.md