mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 03:00:54 +00:00
Adds 'status_text' functions to models (#3752)
- Convert status codes into text representation (translated) - Useful for template rendering
This commit is contained in:
@ -670,6 +670,11 @@ class StockItem(InvenTreeBarcodeMixin, MetadataMixin, MPTTModel):
|
||||
choices=StockStatus.items(),
|
||||
validators=[MinValueValidator(0)])
|
||||
|
||||
@property
|
||||
def status_text(self):
|
||||
"""Return the text representation of the status field"""
|
||||
return StockStatus.text(self.status)
|
||||
|
||||
notes = InvenTreeNotesField(help_text=_('Stock Item Notes'))
|
||||
|
||||
purchase_price = InvenTreeModelMoneyField(
|
||||
|
Reference in New Issue
Block a user