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,11 +94,10 @@ class FolderMixIn(ExtensionClass.Base): ...@@ -94,11 +94,10 @@ class FolderMixIn(ExtensionClass.Base):
# And made the code more difficult to update # And made the code more difficult to update
portal_type = container.allowedContentTypes()[0].id portal_type = container.allowedContentTypes()[0].id
if temp_object:
from Products.ERP5Type import Document
# we get an object from factory only for first temp container 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 # otherwise we get an id so we can use the classic way
if not getattr(container, 'isTempObject', lambda: 0)(): if temp_object and not getattr(container, 'isTempObject', lambda: 0)():
from Products.ERP5Type import Document
factory_name = 'newTemp%s' %(portal_type.replace(' ', '')) factory_name = 'newTemp%s' %(portal_type.replace(' ', ''))
m = getattr(Document, factory_name) m = getattr(Document, factory_name)
new_instance = m(container, new_id) new_instance = m(container, new_id)
......
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