diff --git a/product/ERP5/Document/AmortisationRule.py b/product/ERP5/Document/AmortisationRule.py
index 1949c97c85e8d61da1d209341c92fde38596fe85..3dd390777a3d490e4b55227b52662882a00bbc0a 100644
--- a/product/ERP5/Document/AmortisationRule.py
+++ b/product/ERP5/Document/AmortisationRule.py
@@ -677,7 +677,7 @@ class AmortisationRule(Rule):
       # We have each matching ratio. Now we need to match each amortisation period
       # according to these ratio : the highest ratio gets the priority, then the next
       # highest is taken into account if corresponding resources are free, and so on
-      matching_ratio_list.sort(key=lambda x: -x['ratio'])
+      matching_ratio_list.sort(key=lambda x: x['ratio'], reverse=True)
       calculated_to_match = calculated_period_dict.keys()
       aggregated_to_match = aggregated_period_dict.keys()
       match_dict = {}
diff --git a/product/ERP5Form/PreferenceTool.py b/product/ERP5Form/PreferenceTool.py
index 00b20293a7dbf4269d3cc988d874d340484c7656..b379529ee3bb5824c05d7e3eab829c508cc5345c 100644
--- a/product/ERP5Form/PreferenceTool.py
+++ b/product/ERP5Form/PreferenceTool.py
@@ -228,11 +228,11 @@ class PreferenceTool(BaseTool):
             prefs.append(pref)
         else :
           prefs.append(pref)
-    prefs.sort(key=lambda x: -x.getPriority())
+    prefs.sort(key=lambda x: x.getPriority(), reverse=True)
     # add system preferences after user preferences
     sys_prefs = [x.getObject() for x in self.searchFolder(portal_type='System Preference', **kw) \
                  if x.getObject().getProperty('preference_state', 'broken') in ('enabled', 'global')]
-    sys_prefs.sort(key=lambda x: -x.getPriority())
+    sys_prefs.sort(key=lambda x: x.getPriority(), reverse=True)
     return sys_prefs + prefs
 
   security.declareProtected(Permissions.View, 'getActivePreference')