Closed axibo-reiner closed 1 year ago
@axibo-reiner this is all achievable right now. I realize there are no examples in the documentation about this. I'll add the following example which you can use for now as a starting point:
from inventree.api import InvenTreeAPI
from inventree.part import Part
api = InvenTreeAPI(host='http://localhost:8000', username='admin', password='inventree')
# Retrieve part instance
part = Part(api, pk=1)
# Update specified part parameters
part.save(data={
"description": "New part description",
"minimum_stock": 250,
})
# Reload data from remote server
part.reload()
print("Part Name:", part.name)
print("Description:", part.description)
print("Minimum stock:", part.minimum_stock)
Edit the base properties of a part, such as minimum-stock.