Commit f1913678 authored by Sebastien Robin's avatar Sebastien Robin

- do not specify id when creating temp object

- make sure that the portal type is initialized before searching data
  into Base._aq_portal_type


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23606 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9c9dcdc6
...@@ -66,7 +66,7 @@ class TempObjectLibrary(object): ...@@ -66,7 +66,7 @@ class TempObjectLibrary(object):
container = self(random.choice(possible_parent_list)) container = self(random.choice(possible_parent_list))
else: else:
container = self.root container = self.root
temp_object = container.newContent(portal_type=portal_type, temp_object=1, id=portal_type) temp_object = container.newContent(portal_type=portal_type, temp_object=1)
self.portal_type_dict[portal_type] = temp_object self.portal_type_dict[portal_type] = temp_object
return temp_object return temp_object
......
...@@ -98,7 +98,12 @@ class PortalTypeInstanceDocumentationHelper(DocumentationHelper): ...@@ -98,7 +98,12 @@ class PortalTypeInstanceDocumentationHelper(DocumentationHelper):
def _getPropertyHolder(self): def _getPropertyHolder(self):
from Products.ERP5Type.Base import Base from Products.ERP5Type.Base import Base
return Base.aq_portal_type[(self.getPortalType(), self.getInstance().__class__)] property_holder = None
key = (self.getPortalType(), self.getInstance().__class__)
if not(Base.aq_portal_type.has_key(key)):
self.getInstance().initializePortalTypeDynamicProperties()
property_holder = Base.aq_portal_type[(self.getPortalType(), self.getInstance().__class__)]
return property_holder
security.declareProtected( Permissions.AccessContentsInformation, 'getAccessorMethodItemList' ) security.declareProtected( Permissions.AccessContentsInformation, 'getAccessorMethodItemList' )
def getAccessorMethodItemList(self): def getAccessorMethodItemList(self):
......
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