From 9a67f4f2b5c84c113b6f3622e4502c95b245a9ea Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 11 Mar 2021 08:00:10 +0100 Subject: [PATCH] Added example for stock locations How t o add stock locations and stock items --- docs/extend/python.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/extend/python.md b/docs/extend/python.md index 2b33dfe..be4a224 100644 --- a/docs/extend/python.md +++ b/docs/extend/python.md @@ -129,6 +129,8 @@ If we have several sofas on stock we need to know there we have stored them. So from inventree.stock import StockLocation from inventree.stock import StockItem +... + ## Create the stock locations. Leave the parent empty for top level hierarchy Aisle3 = StockLocation.create(api, {'name':'Aisle 3','description':'Aisle for sofas','parent':''}) Shelve43 = StockLocation.create(api, {'name':'Shelve 43','description':'Shelve for sofas','parent':Aisle3.pk}) @@ -137,18 +139,18 @@ Box13 = StockLocation.create(api, {'name':'Box 13','description':'red box','pare ## Now fill them with items Id1 = StockItem.create(api, { 'part': sofa.pk, 'quantity': 10, 'notes': 'new ones', 'location': Box12.pk, ‘status’:10 }) -Id2 = StockItem.create(api, { 'part': sofa.pk, 'quantity': 3, 'notes': 'old ones', 'location': Box13.pk, ‘status’:55 }) +Id2 = StockItem.create(api, { 'part': sofa.pk, 'quantity': 3, 'notes': 'old ones', 'location': Box13.pk, ‘status’:55 }) ``` Please recognize the different status flags. 10 means OK, 55 means damaged. We have the following choices: -* 10 OK -* 50 Attention needed -* 55 Damaged -* 60 Destroyed -* 65 Rejected -* 70 Lost -* 85 Returned +* 10: OK +* 50: Attention needed +* 55: Damaged +* 60: Destroyed +* 65: Rejected +* 70: Lost +* 85: Returned #### Adding manufacturers and supplier