Commit cc4128cf authored by Jérome Perrin's avatar Jérome Perrin

Base_asXML: sort properties in asXML

The order is used during syncml and if "title" comes before "first_name"
and "last_name", synchronizing persons causes conflicts (because title
of persons is computed from first_name and last_name).
Luckily, sorting properties gives an order that is OK for syncml tests,
so we don't need to invent a new mechanism to control the order of
properties in asXML.
parent 62f09430
...@@ -97,7 +97,7 @@ def Base_asXML(object, root=None): ...@@ -97,7 +97,7 @@ def Base_asXML(object, root=None):
portal_type=self.getPortalType())) portal_type=self.getPortalType()))
# We have to find every property # We have to find every property
for prop_id in set(self.propertyIds()): for prop_id in sorted(set(self.propertyIds())):
# In most case, we should not synchronize acquired properties # In most case, we should not synchronize acquired properties
if prop_id not in ('uid', 'workflow_history', 'id', 'portal_type') and (prop_id != 'user_id' or 'ERP5User' not in getattr( if prop_id not in ('uid', 'workflow_history', 'id', 'portal_type') and (prop_id != 'user_id' or 'ERP5User' not in getattr(
getattr( getattr(
......
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