Commit 92cfaa96 authored by Fabien Morin's avatar Fabien Morin

fixed a problem on the contact deletion on the mobile phone


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16092 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c8a6b797
...@@ -1072,8 +1072,16 @@ class XMLSyncUtilsMixin(SyncCode): ...@@ -1072,8 +1072,16 @@ class XMLSyncUtilsMixin(SyncCode):
signature.setRid(rid) signature.setRid(rid)
#LOG('gid == rid ?', DEBUG, 'gid=%s, rid=%s' % (gid, rid)) #LOG('gid == rid ?', DEBUG, 'gid=%s, rid=%s' % (gid, rid))
object = subscriber.getObjectFromGid(gid) object = subscriber.getObjectFromGid(gid)
if object is None and not(domain.getSynchronizeWithERP5Sites()): if object == None and not(domain.getSynchronizeWithERP5Sites()):
#if the object is None, that could mean two things :
# - the object to synchronize don't exists
# - the id is not a gid but a rid
#here we try to find an object with the rid
#LOG('applyActionList, try to find an object with rid', DEBUG, '')
object = subscriber.getObjectFromRid(rid) object = subscriber.getObjectFromRid(rid)
signature = subscriber.getSignatureFromRid(rid)
if signature not in ('', None):
gid = signature.getId()
#LOG('applyActionList subscriber.getObjectFromGid %s' % gid, DEBUG, object) #LOG('applyActionList subscriber.getObjectFromGid %s' % gid, DEBUG, object)
if signature is None: if signature is None:
#LOG('applyActionList, signature is None', DEBUG, signature) #LOG('applyActionList, signature is None', DEBUG, signature)
...@@ -1198,6 +1206,7 @@ class XMLSyncUtilsMixin(SyncCode): ...@@ -1198,6 +1206,7 @@ class XMLSyncUtilsMixin(SyncCode):
data_subnode = self.getDataText(action) data_subnode = self.getDataText(action)
else: else:
data_subnode = self.getDataSubNode(action) data_subnode = self.getDataSubNode(action)
#LOG('applyActionList, object gid to delete :', 0, subscriber.getObjectFromGid(object_id))
if subscriber.getObjectFromGid(object_id) not in (None, ''): if subscriber.getObjectFromGid(object_id) not in (None, ''):
#if the object exist: #if the object exist:
conduit.deleteNode( conduit.deleteNode(
...@@ -1691,4 +1700,4 @@ class XMLSyncUtils(XMLSyncUtilsMixin): ...@@ -1691,4 +1700,4 @@ class XMLSyncUtils(XMLSyncUtilsMixin):
def getActivityType(self, domain): def getActivityType(self, domain):
if domain.getActivityEnabled(): if domain.getActivityEnabled():
return 'SQLDict' return 'SQLDict'
return 'RAMQueue' return 'RAMQueue'
\ No newline at end of file
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