[IMP] use sorted + key instead of sort + cmp

This commit is contained in:
Xavier Morel 2014-05-27 11:31:22 +02:00
parent 3d91b2dfa2
commit ad33728043
1 changed files with 1 additions and 2 deletions

View File

@ -63,8 +63,7 @@ class view(osv.osv):
if options:
todo += filter(lambda x: not x.inherit_id, view.inherited_option_ids)
# Keep options in a determinitic order whatever their enabled disabled status
todo.sort(lambda x,y:cmp(x.id,y.id))
for child_view in todo:
for child_view in sorted(todo, key=lambda v: v.id):
for r in self._views_get(cr, uid, child_view, options=bool(child_view.inherit_id), context=context, root=False):
if r not in result:
result.append(r)