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): ...@@ -1018,19 +1018,19 @@ class ERP5Conduit(XMLSyncUtilsMixin):
if object_id is not None: if object_id is not None:
if sub_object is None: if sub_object is None:
sub_object = object._getOb(object_id, None) sub_object = object._getOb(object_id, None)
if sub_object is None: # If so, it doesn't exist if sub_object is None: # If so, it doesn't exist
portal_type = '' portal_type = ''
if xml.xpath('local-name()') == XML_OBJECT_TAG: if xml.xpath('local-name()') == XML_OBJECT_TAG:
portal_type = self.getObjectType(xml) portal_type = self.getObjectType(xml)
sub_object, reset_local_roles, reset_workflow = self.constructContent( sub_object, reset_local_roles, reset_workflow = self.constructContent(
object, object,
object_id, object_id,
portal_type) portal_type)
self.newObject(object=sub_object, self.newObject(object=sub_object,
xml=xml, xml=xml,
simulate=simulate, simulate=simulate,
reset_local_roles=reset_local_roles, reset_local_roles=reset_local_roles,
reset_workflow=reset_workflow) reset_workflow=reset_workflow)
return sub_object return sub_object
def _updateContent(self, object=None, **args): 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