[ui] Fix SelectAmbiguity on archive unit content's tab
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 21 Jul 2016 09:22:09 +0200
changeset 1472 bdc86d35b797
parent 1471 573248320056
child 1473 9a2147273199
[ui] Fix SelectAmbiguity on archive unit content's tab Because SEDAContent had two list item views returning the same score.
views/archiveunit.py
--- a/views/archiveunit.py	Thu Jul 21 09:21:17 2016 +0200
+++ b/views/archiveunit.py	Thu Jul 21 09:22:09 2016 +0200
@@ -17,7 +17,7 @@
 
 from copy import deepcopy
 
-from logilab.common.registry import objectify_predicate
+from logilab.common.registry import objectify_predicate, yes
 
 from cubicweb import tags
 from cubicweb.predicates import is_instance
@@ -147,11 +147,12 @@
                               w=self.w)
 
 
-class TitleBusinessValueEntityView(viewlib.BusinessValueLinkEntityView):
+class TitleBusinessValueEntityView(viewlib.BusinessValueEntityView):
     """Entity view for SEDAContent entities that will display value of the SEDATitle related
     element.
     """
-    __select__ = is_instance('SEDAContent')
+    # add yes(1) to overtake BusinessValueLinkEntityView
+    __select__ = is_instance('SEDAContent') & yes(1)
     no_value_msg = _('<no title specified>')
 
     def entity_value(self, entity):