2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-04-28 13:46:54 +00:00

Added example for stock locations

How t o add stock locations and stock items
This commit is contained in:
Michael 2021-03-11 08:00:10 +01:00 committed by GitHub
parent 49d567270b
commit 9a67f4f2b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 StockLocation
from inventree.stock import StockItem from inventree.stock import StockItem
...
## Create the stock locations. Leave the parent empty for top level hierarchy ## Create the stock locations. Leave the parent empty for top level hierarchy
Aisle3 = StockLocation.create(api, {'name':'Aisle 3','description':'Aisle for sofas','parent':''}) 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}) 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 ## Now fill them with items
Id1 = StockItem.create(api, { 'part': sofa.pk, 'quantity': 10, 'notes': 'new ones', 'location': Box12.pk, status:10 }) 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: Please recognize the different status flags. 10 means OK, 55 means damaged. We have the following choices:
* 10 OK * 10: OK
* 50 Attention needed * 50: Attention needed
* 55 Damaged * 55: Damaged
* 60 Destroyed * 60: Destroyed
* 65 Rejected * 65: Rejected
* 70 Lost * 70: Lost
* 85 Returned * 85: Returned
#### Adding manufacturers and supplier #### Adding manufacturers and supplier