cubicweb/web/views/editforms.py
branch3.25
changeset 12184 cd940ebefc4e
parent 12091 3c9e296f0a6a
child 12503 b01dd0ef43aa
--- a/cubicweb/web/views/editforms.py	Wed Apr 19 11:10:58 2017 +0200
+++ b/cubicweb/web/views/editforms.py	Fri May 05 17:57:10 2017 +0200
@@ -77,7 +77,8 @@
 
     def _iter_composite_entities(self, entity, limit=None):
         eids = set()
-        for rdef, role in entity.e_schema.composite_rdef_roles:
+        for rdef, role in sorted(entity.e_schema.composite_rdef_roles,
+                                 key=lambda x: x[0].rtype):
             if rdef.rtype in self.show_composite_skip_rtypes:
                 continue
             for centity in entity.related(