mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Handle case where 'title' does not exist (#5767)
This commit is contained in:
parent
f0f4a20f4e
commit
388b722de1
@ -2206,7 +2206,7 @@ class StockItemTracking(models.Model):
|
||||
Note: 2021-05-11
|
||||
The legacy StockTrackingItem model contained very little information about the "history" of the item.
|
||||
In fact, only the "quantity" of the item was recorded at each interaction.
|
||||
Also, the "title" was translated at time of generation, and thus was not really translateable.
|
||||
Also, the "title" was translated at time of generation, and thus was not really translatable.
|
||||
The "new" system tracks all 'delta' changes to the model,
|
||||
and tracks change "type" which can then later be translated
|
||||
|
||||
@ -2233,7 +2233,8 @@ class StockItemTracking(models.Model):
|
||||
"""Return label."""
|
||||
if self.tracking_type in StockHistoryCode.keys():
|
||||
return StockHistoryCode.label(self.tracking_type)
|
||||
return self.title
|
||||
|
||||
return getattr(self, 'title', '')
|
||||
|
||||
tracking_type = models.IntegerField(
|
||||
default=StockHistoryCode.LEGACY,
|
||||
|
Loading…
Reference in New Issue
Block a user