summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 2c8595a99..13e91a680 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -3178,7 +3178,7 @@ class Document(OwnPerms, ImageModel, FullSearch):
receipt_date_in_documentation = models.DateField(
blank=True, null=True,
verbose_name=_(u"Receipt date in documentation"))
- item_number = models.IntegerField(_(u"Item number"), default=1)
+ item_number = models.IntegerField(_(u"Number of items"), default=1)
description = models.TextField(_(u"Description"), blank=True, null=True)
comment = models.TextField(_(u"Comment"), blank=True, null=True)
additional_information = models.TextField(_(u"Additional information"),
@@ -3220,6 +3220,12 @@ class Document(OwnPerms, ImageModel, FullSearch):
"""
@property
+ def associated_file_name(self):
+ if not self.associated_file:
+ return ""
+ return os.path.basename(self.associated_file.name)
+
+ @property
def images(self):
# mimic a queryset pointing to himself
return Document.objects.filter(