Commit 48b3a1ba authored by Nicolas Delaby's avatar Nicolas Delaby

Do not return xml_mapping on subscription if sync type is one way from server

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15500 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f0bfbb94
...@@ -777,10 +777,10 @@ class Subscription(Folder, SyncCode): ...@@ -777,10 +777,10 @@ class Subscription(Folder, SyncCode):
# XXXXXXXXXXXXXXXXXXXXXXXXXXXXX # XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
code = self.SLOW_SYNC code = self.SLOW_SYNC
if len(self.objectValues()) > 0: if len(self.objectValues()) > 0:
code = self.TWO_WAY code = self.getAlertCode()
if default is not None: if default is not None:
code = default code = default
# LOG('Subscription',0,'getSynchronizationType: %s' % code) #LOG('Subscription',0,'getSynchronizationType: %s' % code)
return code return code
def setXMLMapping(self, value): def setXMLMapping(self, value):
...@@ -912,21 +912,23 @@ class Subscription(Folder, SyncCode): ...@@ -912,21 +912,23 @@ class Subscription(Folder, SyncCode):
""" """
self.publication_url = publication_url self.publication_url = publication_url
def getXMLMapping(self): def getXMLMapping(self, force=0):
""" """
return the xml mapping 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 return xml_mapping
def getXMLFromObject(self,object): def getXMLFromObject(self, object):
""" """
return the xml mapping return the xml mapping
""" """
xml_mapping = self.getXMLMapping() xml_mapping = self.getXMLMapping()
xml = '' xml = ''
if xml_mapping is not None: if xml_mapping is not None:
func = getattr(object,xml_mapping,None) func = getattr(object, xml_mapping, None)
if func is not None: if func is not None:
xml = func() xml = func()
return xml return xml
...@@ -936,7 +938,7 @@ class Subscription(Folder, SyncCode): ...@@ -936,7 +938,7 @@ class Subscription(Folder, SyncCode):
This set the method name wich allows to find a gid This set the method name wich allows to find a gid
from any object from any object
""" """
if method in (None,'','None'): if method in (None, '', 'None'):
method = 'getId' method = 'getId'
self.gid_generator = method self.gid_generator = method
......
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