Hide relations tab for data-object in simplified seda profiles
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 26 Aug 2016 09:21:45 +0200
changeset 1579 7fcc34c201fe
parent 1578 c0e49ad09701
child 1586 3f8a4288c11e
Hide relations tab for data-object in simplified seda profiles
views/dataobject.py
--- a/views/dataobject.py	Fri Aug 26 09:05:51 2016 +0200
+++ b/views/dataobject.py	Fri Aug 26 09:21:45 2016 +0200
@@ -27,7 +27,7 @@
 from cubes.skos.views import widgets as skos
 
 from cubes.seda.xsd2yams import RDEF_CONSTRAINTS
-from cubes.seda.entities import parent_and_container, simplified_profile
+from cubes.seda.entities import parent_and_container, simplified_profile, full_seda2_profile
 from cubes.seda.views import rtags_from_xsd_element, add_subobject_link
 from cubes.seda.views import viewlib, copy_rtag
 from cubes.seda.views import uicfg as sedauicfg  # noqa - ensure those rules are defined first
@@ -227,8 +227,8 @@
     """Display relations of a binary or physical data object"""
 
     __regid__ = 'seda_do_relations'
-    __select__ = tabs.PrimaryTab.__select__ & is_instance('SEDABinaryDataObject',
-                                                          'SEDAPhysicalDataObject')
+    __select__ = (is_instance('SEDABinaryDataObject', 'SEDAPhysicalDataObject')
+                  & full_seda2_profile())
 
     _('creating SEDARelationship (SEDARelationship seda_relationship '
       'SEDABinaryDataObject %(linkto)s)')