Commit 587fcaec authored by Nicolas Delaby's avatar Nicolas Delaby

Allow to create document without specified id

Unknown ids must not prevent to create a document, so let ERP5 compute new ids.
parent d9ab3412
......@@ -1018,19 +1018,19 @@ class ERP5Conduit(XMLSyncUtilsMixin):
if object_id is not None:
if sub_object is None:
sub_object = object._getOb(object_id, None)
if sub_object is None: # If so, it doesn't exist
portal_type = ''
if xml.xpath('local-name()') == XML_OBJECT_TAG:
portal_type = self.getObjectType(xml)
sub_object, reset_local_roles, reset_workflow = self.constructContent(
object,
object_id,
portal_type)
self.newObject(object=sub_object,
xml=xml,
simulate=simulate,
reset_local_roles=reset_local_roles,
reset_workflow=reset_workflow)
if sub_object is None: # If so, it doesn't exist
portal_type = ''
if xml.xpath('local-name()') == XML_OBJECT_TAG:
portal_type = self.getObjectType(xml)
sub_object, reset_local_roles, reset_workflow = self.constructContent(
object,
object_id,
portal_type)
self.newObject(object=sub_object,
xml=xml,
simulate=simulate,
reset_local_roles=reset_local_roles,
reset_workflow=reset_workflow)
return sub_object
def _updateContent(self, object=None, **args):
......
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