smarter default for actionbox_appearsin_addmenu
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 25 Sep 2009 11:54:49 +0200
changeset 3480 370d20fec445
parent 3479 d4fbf41adb5b
child 3481 d614369df4b3
smarter default for actionbox_appearsin_addmenu
web/uicfg.py
--- a/web/uicfg.py	Fri Sep 25 11:54:03 2009 +0200
+++ b/web/uicfg.py	Fri Sep 25 11:54:49 2009 +0200
@@ -410,6 +410,9 @@
 # 'link' / 'create' relation tags, used to control the "add entity" submenu
 def init_actionbox_appearsin_addmenu(rtag, sschema, rschema, oschema, role):
     if rtag.get(sschema, rschema, oschema, role) is None:
+        if rschema in META_RTYPES:
+            rtag.tag_relation((sschema, rschema, oschema, role), False)
+            return
         card = rschema.rproperty(sschema, oschema, 'cardinality')[role == 'object']
         if not card in '?1' and \
                rschema.rproperty(sschema, oschema, 'composite') == role: