Commit 96e23f57 authored by Aurel's avatar Aurel

allow to pass parameter isIndexable to newContent


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4764 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6f55c776
...@@ -64,7 +64,7 @@ class FolderMixIn(ExtensionClass.Base): ...@@ -64,7 +64,7 @@ class FolderMixIn(ExtensionClass.Base):
security.declareProtected(Permissions.AddPortalContent, 'newContent') security.declareProtected(Permissions.AddPortalContent, 'newContent')
def newContent(self, id=None, portal_type=None, id_group=None, def newContent(self, id=None, portal_type=None, id_group=None,
default=None, method=None, immediate_reindex=0, default=None, method=None, immediate_reindex=0,
container=None, bypass_init_script=0, activate_kw=None,**kw): container=None, bypass_init_script=0, activate_kw=None, isIndexable=None, **kw):
""" """
Creates a new content Creates a new content
""" """
...@@ -82,7 +82,8 @@ class FolderMixIn(ExtensionClass.Base): ...@@ -82,7 +82,8 @@ class FolderMixIn(ExtensionClass.Base):
container=container, container=container,
id=new_id, id=new_id,
bypass_init_script=bypass_init_script, bypass_init_script=bypass_init_script,
activate_kw=activate_kw activate_kw=activate_kw,
isIndexable=isIndexable
) # **kw) removed due to CMF bug ) # **kw) removed due to CMF bug
new_instance = container[new_id] new_instance = container[new_id]
if kw != {} : new_instance._edit(force_update=1, **kw) if kw != {} : new_instance._edit(force_update=1, **kw)
......
...@@ -309,10 +309,12 @@ class DocumentConstructor(Method): ...@@ -309,10 +309,12 @@ class DocumentConstructor(Method):
def __init__(self, klass): def __init__(self, klass):
self.klass = klass self.klass = klass
def __call__(self, folder, id, REQUEST=None, activate_kw=None,**kw): def __call__(self, folder, id, REQUEST=None, activate_kw=None, isIndexable=None, **kw):
o = self.klass(id) o = self.klass(id)
if activate_kw is not None: if activate_kw is not None:
o._v_activate_kw = activate_kw o._v_activate_kw = activate_kw
if isIndexable is not None:
o.isIndexable=isIndexable
folder._setObject(id, o) folder._setObject(id, o)
o.uid = folder.portal_catalog.newUid() o.uid = folder.portal_catalog.newUid()
#LOG('DocumentConstructor', 0, 'o = %r, kw = %r' % (o, kw)) #LOG('DocumentConstructor', 0, 'o = %r, kw = %r' % (o, kw))
......
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