From d32e6430e41bb319d44dba3a6ac9208801f6f55a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 29 Jun 2018 11:06:38 +0200 Subject: Sheet: complete images informations --- ishtar_common/models.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ishtar_common/models.py') 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"), @@ -3219,6 +3219,12 @@ class Document(OwnPerms, ImageModel, FullSearch): self.index) """ + @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 -- cgit v1.2.3