mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +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
|
Note: 2021-05-11
|
||||||
The legacy StockTrackingItem model contained very little information about the "history" of the item.
|
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.
|
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,
|
The "new" system tracks all 'delta' changes to the model,
|
||||||
and tracks change "type" which can then later be translated
|
and tracks change "type" which can then later be translated
|
||||||
|
|
||||||
@ -2233,7 +2233,8 @@ class StockItemTracking(models.Model):
|
|||||||
"""Return label."""
|
"""Return label."""
|
||||||
if self.tracking_type in StockHistoryCode.keys():
|
if self.tracking_type in StockHistoryCode.keys():
|
||||||
return StockHistoryCode.label(self.tracking_type)
|
return StockHistoryCode.label(self.tracking_type)
|
||||||
return self.title
|
|
||||||
|
return getattr(self, 'title', '')
|
||||||
|
|
||||||
tracking_type = models.IntegerField(
|
tracking_type = models.IntegerField(
|
||||||
default=StockHistoryCode.LEGACY,
|
default=StockHistoryCode.LEGACY,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user