Commit b2e03135 authored by Jérome Perrin's avatar Jérome Perrin

ERP5Type: Normalize the implementations of TemporaryDocumentMixin and TempBase

Products.ERP5Type.mixin.temporary.TemporaryDocumentMixin and
Products.ERP5Type.Base.TempBase implementations were a bit different:

 - getTitle was acquiring title in TemporaryDocumentMixin, although this
 was probably never acquiring in practice because most documents have
 a title.
 - isIndexable was an int and not a PropertyConstantGetter like it is
 supposed to be.

Change TemporaryDocumentMixin to behave like TempBase here.

=
parent 490a56ba
......@@ -40,7 +40,7 @@ class TemporaryDocumentMixin(object):
"""
Setters and attributes that are attached to temporary documents.
"""
isIndexable = 0
isIndexable = PropertyConstantGetter('isIndexable', value=False)
isTempDocument = PropertyConstantGetter('isTempDocument', value=True)
__roles__ = None
......@@ -85,7 +85,9 @@ class TemporaryDocumentMixin(object):
self.title = value
def getTitle(self):
return getattr(self,'title',None)
"""Returns the title of this document
"""
return getattr(aq_base(self), 'title', None)
def edit(self, *args, **kw):
if getattr(self, "_original", None) is None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment