Commit 8e1487d0 authored by Sebastien Robin's avatar Sebastien Robin

try to look at modification date for object in repo


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1133 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a1b500d5
......@@ -31,6 +31,7 @@ from Products.ERP5SyncML.SyncCode import SyncCode
from Products.ERP5SyncML.Subscription import Signature
from xml.dom.ext.reader.Sax2 import FromXml
from xml.dom.minidom import parse, parseString
from DateTime import DateTime
from cStringIO import StringIO
from xml.dom.ext import PrettyPrint
import random
......@@ -572,9 +573,18 @@ class XMLSyncUtilsMixin(SyncCode):
LOG('getSyncMLData',0,'alert_code == slowsync: %s' % str(self.getAlertCode(remote_xml)==self.SLOW_SYNC))
signature = subscriber.getSignature(object_gid)
LOG('getSyncMLData',0,'current object: %s' % str(object.getId()))
# Here we first check if the object was modified or not by looking at dates
if signature is not None:
LOG('getSyncMLData',0,'signature.status: %s' % str(signature.getStatus()))
LOG('getSyncMLData',0,'signature.action: %s' % str(signature.getAction()))
last_modification = object.ModificationDate()
last_synchronization = signature.getLastSynchronizationDate()
parent = object.aq_parent
# XXX CPS Specific
if parent.id == 'portal_repository':
if last_synchronization is not None and last_modification is not None:
if last_synchronization > last_modification:
signature.setStatus(self.SYNCHRONIZED)
status = self.SENT
more_data=0
# For the case it was never synchronized, we have to send everything
......
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