Add ability to edit 'delete_on_deplete' field

This commit is contained in:
Oliver Walters committed 2019-05-09 23:06:19 +10:00
1 parent ac326c135f
commit 027e1cf130
2 files changed
+7 -5

No files matched your search

+2
View File
@@ -34,6 +34,7 @@ class CreateStockItemForm(HelperForm):
'location', 'location',
'batch', 'batch',
'quantity', 'quantity',
'delete_on_deplete',
'status', 'status',
'notes', 'notes',
'URL', 'URL',
@@ -78,6 +79,7 @@ class EditStockItemForm(HelperForm):
fields = [ fields = [
'supplier_part', 'supplier_part',
'batch', 'batch',
'delete_on_deplete',
'status', 'status',
'notes', 'notes',
'URL', 'URL',
+5 -5
View File
@@ -286,9 +286,9 @@ class StockItem(models.Model):
self.location = location self.location = location
self.addTransactionNote(msg, self.addTransactionNote(msg,
user, user,
notes=notes, notes=notes,
system=True) system=True)
self.save() self.save()
@@ -296,8 +296,8 @@ class StockItem(models.Model):
@transaction.atomic @transaction.atomic
def updateQuantity(self, quantity): def updateQuantity(self, quantity):
""" Update stock quantity for this item. """ Update stock quantity for this item.
If the quantity has reached zero, this StockItem will be deleted. If the quantity has reached zero, this StockItem will be deleted.
Returns: Returns: