diff --git a/product/ERP5/Document/Document.py b/product/ERP5/Document/Document.py index 7d0c4f759f8a1300008ae1771a51d3c6dc39173e..db98dfd24ebdab142234ab8044bbf8458951dfd7 100644 --- a/product/ERP5/Document/Document.py +++ b/product/ERP5/Document/Document.py @@ -1160,3 +1160,22 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin): classes is needed. """ return DateTime() + 10 + + # Standard File Naming + security.declareProtected(Permissions.AccessContentsInformation, 'getStandardFileName') + def getStandardFileName(self): + """ + Returns the document coordinates as a standard file name. + + NOTE: this method must be overloadable by types base method with fallback + """ + if self.getReference(): + file_name = self.getReference() + else: + file_name = self.getTitleOrId() + if self.getVersion(): + file_name = file_name + '-%s' % self.getVersion() + if self.getLanguage(): + file_name = file_name + '-%s' % self.getLanguage() + return file_name + \ No newline at end of file