Commit 9fe3a03d authored by Vincent Pelletier's avatar Vincent Pelletier

Fix creation of temp object inside a temp object broken by my previous patch.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15167 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 60feb380
......@@ -94,14 +94,13 @@ class FolderMixIn(ExtensionClass.Base):
# And made the code more difficult to update
portal_type = container.allowedContentTypes()[0].id
if temp_object:
# we get an object from factory only for first temp container object
# otherwise we get an id so we can use the classic way
if temp_object and not getattr(container, 'isTempObject', lambda: 0)():
from Products.ERP5Type import Document
# we get an object from factory only for first temp container object
# otherwise we get an id so we can use the classic way
if not getattr(container, 'isTempObject', lambda: 0)():
factory_name = 'newTemp%s' %(portal_type.replace(' ', ''))
m = getattr(Document, factory_name)
new_instance = m(container, new_id)
factory_name = 'newTemp%s' %(portal_type.replace(' ', ''))
m = getattr(Document, factory_name)
new_instance = m(container, new_id)
else:
myType = pt.getTypeInfo(container)
if myType is not None and not myType.allowType( portal_type ) and \
......
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