diff --git a/product/ERP5SyncML/Conduit/ERP5Conduit.py b/product/ERP5SyncML/Conduit/ERP5Conduit.py index c93842278bf0947977af105443c7b5dc272b1191..3041d999703cd4090c9ecb6c626e1bb5f0848ece 100644 --- a/product/ERP5SyncML/Conduit/ERP5Conduit.py +++ b/product/ERP5SyncML/Conduit/ERP5Conduit.py @@ -654,6 +654,8 @@ class ERP5Conduit(XMLSyncUtilsMixin): xml_copy = deepcopy(xml) if xml.nsmap is None or xml.nsmap == {}: object_element = xml_copy.find(self.xml_object_tag) + if object_element is None and xml_copy.tag == self.xml_object_tag: + object_element = xml_copy id_element = object_element.find('id') else: object_element = xml_copy.xpath('//syncml:object', diff --git a/product/ERP5SyncML/XMLSyncUtils.py b/product/ERP5SyncML/XMLSyncUtils.py index 5194ea4f37f497a12e7ac55dc327ae0d34a4fe97..bee1b77d03f7ffbe28838a88982afa0ab25a54e3 100644 --- a/product/ERP5SyncML/XMLSyncUtils.py +++ b/product/ERP5SyncML/XMLSyncUtils.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved. @@ -1009,14 +1010,11 @@ class XMLSyncUtilsMixin(SyncCode): # Object was retrieve but need to be updated without recreated # usefull when an object is only deleted by workflow. if data_subnode is not None: - if isinstance(data_subnode, str): - xml_string = etree.XML(data_subnode) - else: - xml_string = data_subnode - actual_xml = conduit.getXMLFromObjectWithId(object,\ - xml_mapping=domain.getXMLMapping(force=1)) + xml_string = conduit.convertToXml(data_subnode) + actual_xml = conduit.getXMLFromObjectWithId(object, + xml_mapping=domain.getXMLMapping(force=1)) + actual_xml = conduit.convertToXml(actual_xml) xml_string_gid = conduit.replaceIdFromXML(xml_string, gid) - actual_xml = etree.XML(actual_xml) actual_xml_gid = conduit.replaceIdFromXML(actual_xml, gid) # use gid as compare key because their ids can be different data_subnode = self.getXupdateObject(xml_string_gid, actual_xml_gid)