mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 12:35:46 +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:
@ -236,6 +236,11 @@ class Build(MPTTModel, ReferenceIndexingMixin):
|
||||
help_text=_('Build status code')
|
||||
)
|
||||
|
||||
@property
|
||||
def status_text(self):
|
||||
"""Return the text representation of the status field"""
|
||||
return BuildStatus.text(self.status)
|
||||
|
||||
batch = models.CharField(
|
||||
verbose_name=_('Batch Code'),
|
||||
max_length=100,
|
||||
|
Reference in New Issue
Block a user