Commit ebebc1e5 authored by Romain Courteaud's avatar Romain Courteaud

Bug fix: modified methods called by instance of TempObject

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2547 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e2887dae
No related merge requests found
...@@ -274,13 +274,12 @@ class DocumentConstructor(Method): ...@@ -274,13 +274,12 @@ class DocumentConstructor(Method):
class TempDocumentConstructor(DocumentConstructor): class TempDocumentConstructor(DocumentConstructor):
def __call__(self, folder, id, REQUEST=None, **kw): def __call__(self, folder, id, REQUEST=None, **kw):
from Products.ERP5Type.Base import TempBase
o = self.klass(id) o = self.klass(id)
o = o.__of__(folder) o = o.__of__(folder)
if kw: o.__of__(folder)._edit(force_update=1, **kw) if kw: o.__of__(folder)._edit(force_update=1, **kw)
# Monkey patch TempBase specific arguments # Monkey patch TempBase specific arguments
for k in ('isIndexable', 'reindexObject', 'recursiveReindexObject', 'activate', 'setUid', ): for k in ('isIndexable', 'reindexObject', 'recursiveReindexObject', 'activate', 'setUid', 'setTitle', 'getTitle'):
setattr(o, k, getattr(TempBase,k)) setattr(o, k, getattr(o,"_temp_%s" % k))
return o return o
python_file_parser = re.compile('^(.*)\.py$') python_file_parser = re.compile('^(.*)\.py$')
...@@ -593,6 +592,7 @@ def importLocalDocument(class_id, document_path = None): ...@@ -593,6 +592,7 @@ def importLocalDocument(class_id, document_path = None):
temp_document_constructor.__name__ = temp_document_constructor_name temp_document_constructor.__name__ = temp_document_constructor_name
setattr(Products.ERP5Type.Document, temp_document_constructor_name, temp_document_constructor) setattr(Products.ERP5Type.Document, temp_document_constructor_name, temp_document_constructor)
ModuleSecurityInfo('Products.ERP5Type.Document').declarePublic(temp_document_constructor_name,) ModuleSecurityInfo('Products.ERP5Type.Document').declarePublic(temp_document_constructor_name,)
# Update Meta Types # Update Meta Types
new_meta_types = [] new_meta_types = []
for meta_type in Products.meta_types: for meta_type in Products.meta_types:
......
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