Commit ce73ac10 authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

[views] fix externaluricomponent (same_as is symetric)

parent 6605bce14e2f
......@@ -25,7 +25,7 @@ uicfg.actionbox_appearsin_addmenu.tag_subject_of(('ClassifiedAd', 'has_image', '
class ExternalUriComponent(component.EntityVComponent):
"""component to display link to external uri"""
__regid__ = 'externaluricomp'
__select__ = (component.EntityVComponent.__select__ & has_related_entities('same_as'))
__select__ = (component.EntityVComponent.__select__ & has_related_entities('same_as') & ~implements('ExternalUri'))
context = 'ctxtoolbar'
......@@ -36,7 +36,7 @@ class ExternalUriComponent(component.EntityVComponent):
entity = self.cw_rset.get_entity(row, col)
self.w(u'<div class="toolbarButton" id="%s">' % self.div_id())
imgurl = self._cw.external_resource('BLUE_ARROW')
if entity.url:
if hasattr(entity, 'url'):
url = entity.url
else:
url = entity.same_as[0].uri
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment