diff --git a/product/ERP5SyncML/Signature.py b/product/ERP5SyncML/Signature.py index c0c94a6e0282b504213879a2f812c62e157a2fde..118690068b9eab0e26f3156a016a4768216b8748 100644 --- a/product/ERP5SyncML/Signature.py +++ b/product/ERP5SyncML/Signature.py @@ -194,7 +194,7 @@ class Signature(Folder, SyncCode, File): else: self.xml = None - def getXML(self): + def getXML(self, default=None): """ get the XML corresponding to the object """ @@ -207,7 +207,7 @@ class Signature(Folder, SyncCode, File): else: raise ValueError, "the self.xml haven't good type" else: - return None + return default def hasTempXML(self): """ @@ -227,7 +227,7 @@ class Signature(Folder, SyncCode, File): else: self.temp_xml = None - def getTempXML(self): + def getTempXML(self, default=None): """ get the temp xml """ @@ -239,7 +239,7 @@ class Signature(Folder, SyncCode, File): else: raise ValueError, "the self.xml haven't good type" else: - return None + return default def setSubscriberXupdate(self, xupdate): """ @@ -411,7 +411,7 @@ class Signature(Folder, SyncCode, File): return ''.join(chunk) - def getPartialXML(self): + def getPartialXML(self, default=None): """ Set the partial string we will have to deliver in the future @@ -422,7 +422,7 @@ class Signature(Folder, SyncCode, File): else: raise ValueError, "the self.xml haven't good type" else: - return None + return default def getAction(self): """ diff --git a/product/ERP5SyncML/XMLSyncUtils.py b/product/ERP5SyncML/XMLSyncUtils.py index 84fba38beb4da5e8f885fb8ff4b2e71d6d961955..32aad07f88d91893b70a267efaf82aa59846db2d 100644 --- a/product/ERP5SyncML/XMLSyncUtils.py +++ b/product/ERP5SyncML/XMLSyncUtils.py @@ -614,7 +614,7 @@ class XMLSyncUtilsMixin(SyncCode): the data are : cmd, code and source """ status_list = [] - status_node_list = xml.xpath('//syncml:Status') + status_node_list = xml.xpath('//syncml:Status', namespaces=xml.nsmap) for status in status_node_list: tmp_dict = {} tmp_dict['cmd'] = '%s' % status.xpath('string(./syncml:Cmd)', @@ -878,7 +878,7 @@ class XMLSyncUtilsMixin(SyncCode): cmd='Replace')) signature.setStatus(self.SYNCHRONIZED) elif signature.getStatus() == self.PARTIAL: - xml_string = signature.getPartialXML() + xml_string = signature.getPartialXML(default='') if(subscriber.getMediaType() != self.MEDIA_TYPE['TEXT_XML']): xml_to_send = conduit.getXMLFromObjectWithId(object,\ xml_mapping=domain.getXMLMapping())