[Erp5-report] r15500 - /erp5/trunk/products/ERP5SyncML/Subscription.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Aug 6 17:10:08 CEST 2007


Author: nicolas
Date: Mon Aug  6 17:10:08 2007
New Revision: 15500

URL: http://svn.erp5.org?rev=15500&view=rev
Log:
Do not return xml_mapping on subscription if sync type is one way from server

Modified:
    erp5/trunk/products/ERP5SyncML/Subscription.py

Modified: erp5/trunk/products/ERP5SyncML/Subscription.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/Subscription.py?rev=15500&r1=15499&r2=15500&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/Subscription.py (original)
+++ erp5/trunk/products/ERP5SyncML/Subscription.py Mon Aug  6 17:10:08 2007
@@ -777,10 +777,10 @@
     # XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
     code = self.SLOW_SYNC
     if len(self.objectValues()) > 0:
-      code = self.TWO_WAY
+      code = self.getAlertCode()
     if default is not None:
       code = default
-    # LOG('Subscription',0,'getSynchronizationType: %s' % code)
+    #LOG('Subscription',0,'getSynchronizationType: %s' % code)
     return code
 
   def setXMLMapping(self, value):
@@ -912,21 +912,23 @@
     """
     self.publication_url = publication_url
 
-  def getXMLMapping(self):
+  def getXMLMapping(self, force=0):
     """
       return the xml mapping
     """
-    xml_mapping = getattr(self,'xml_mapping','asXML')
+    if self.isOneWayFromServer() and force == 0:
+      return None
+    xml_mapping = getattr(self, 'xml_mapping', None)
     return xml_mapping
 
-  def getXMLFromObject(self,object):
+  def getXMLFromObject(self, object):
     """
       return the xml mapping
     """
     xml_mapping = self.getXMLMapping()
     xml = ''
     if xml_mapping is not None:
-      func = getattr(object,xml_mapping,None)
+      func = getattr(object, xml_mapping, None)
       if func is not None:
         xml = func()
     return xml
@@ -936,7 +938,7 @@
     This set the method name wich allows to find a gid
     from any object
     """
-    if method in (None,'','None'):
+    if method in (None, '', 'None'):
       method = 'getId'
     self.gid_generator = method
 




More information about the Erp5-report mailing list