mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
remove old fields from the StockItemTracking model
This commit is contained in:
parent
03a231bffb
commit
68b53acbf1
@ -389,7 +389,7 @@ class StockList(generics.ListCreateAPIView):
|
||||
serializer = self.get_serializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
|
||||
item = serializer.save(user=user, commit=False)
|
||||
item = serializer.save(user=user)
|
||||
|
||||
# A location was *not* specified - try to infer it
|
||||
if 'location' not in request.data:
|
||||
|
@ -437,14 +437,15 @@ class EditStockItemForm(HelperForm):
|
||||
|
||||
|
||||
class TrackingEntryForm(HelperForm):
|
||||
""" Form for creating / editing a StockItemTracking object.
|
||||
"""
|
||||
Form for creating / editing a StockItemTracking object.
|
||||
|
||||
Note: 2021-05-11 - This form is not currently used - should delete?
|
||||
"""
|
||||
|
||||
class Meta:
|
||||
model = StockItemTracking
|
||||
|
||||
fields = [
|
||||
'title',
|
||||
'notes',
|
||||
'link',
|
||||
]
|
||||
|
29
InvenTree/stock/migrations/0063_auto_20210511_2343.py
Normal file
29
InvenTree/stock/migrations/0063_auto_20210511_2343.py
Normal file
@ -0,0 +1,29 @@
|
||||
# Generated by Django 3.2 on 2021-05-11 13:43
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('stock', '0062_auto_20210511_2151'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='stockitemtracking',
|
||||
name='link',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='stockitemtracking',
|
||||
name='quantity',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='stockitemtracking',
|
||||
name='system',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='stockitemtracking',
|
||||
name='title',
|
||||
),
|
||||
]
|
@ -1626,13 +1626,10 @@ class StockItemTracking(models.Model):
|
||||
Attributes:
|
||||
item: ForeignKey reference to a particular StockItem
|
||||
date: Date that this tracking info was created
|
||||
title: Title of this tracking info (legacy, no longer used!)
|
||||
tracking_type: The type of tracking information
|
||||
notes: Associated notes (input by user)
|
||||
link: Optional URL to external page
|
||||
user: The user associated with this tracking info
|
||||
deltas: The changes associated with this history item
|
||||
quantity: The StockItem quantity at this point in time
|
||||
"""
|
||||
|
||||
def get_absolute_url(self):
|
||||
@ -1657,13 +1654,6 @@ class StockItemTracking(models.Model):
|
||||
|
||||
date = models.DateTimeField(auto_now_add=True, editable=False)
|
||||
|
||||
title = models.CharField(
|
||||
blank=True, null=True,
|
||||
max_length=250,
|
||||
verbose_name=_('Title'),
|
||||
help_text=_('Tracking entry title')
|
||||
)
|
||||
|
||||
notes = models.CharField(
|
||||
blank=True, null=True,
|
||||
max_length=512,
|
||||
@ -1671,22 +1661,10 @@ class StockItemTracking(models.Model):
|
||||
help_text=_('Entry notes')
|
||||
)
|
||||
|
||||
link = InvenTreeURLField(blank=True, verbose_name=_('Link'), help_text=_('Link to external page for further information'))
|
||||
|
||||
user = models.ForeignKey(User, on_delete=models.SET_NULL, blank=True, null=True)
|
||||
|
||||
system = models.BooleanField(default=False)
|
||||
|
||||
deltas = models.JSONField(null=True, blank=True)
|
||||
|
||||
quantity = models.DecimalField(
|
||||
max_digits=15,
|
||||
decimal_places=5,
|
||||
validators=[MinValueValidator(0)],
|
||||
default=1,
|
||||
verbose_name=_('Quantity')
|
||||
)
|
||||
|
||||
|
||||
def rename_stock_item_test_result_attachment(instance, filename):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user