From 8c9d2602a3cd46e013c5ef7e5785e5ba83b8ae68 Mon Sep 17 00:00:00 2001
From: Alexandre Boeglin <alex@nexedi.com>
Date: Thu, 30 Jun 2005 09:19:28 +0000
Subject: [PATCH] Not displaying the relation field 'wheel' was not a good
 idea, as there is no more way to distinguish a relation field from a plain
 field, nor to display a huge list of possibilities.

The better way to prevent jumping to related objects is simply to display a
listbox without clickable links.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3375 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/MultiRelationField.py | 5 ++---
 product/ERP5Form/RelationField.py      | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/product/ERP5Form/MultiRelationField.py b/product/ERP5Form/MultiRelationField.py
index d4fb159983..4fbd1b61d5 100755
--- a/product/ERP5Form/MultiRelationField.py
+++ b/product/ERP5Form/MultiRelationField.py
@@ -149,7 +149,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, RelationField.R
                     # Delete default tales on the fly
                     field.tales['items'] = None
 
-                elif field.get_value('allow_jump') == 1 :
+                else:
                   html_string += '&nbsp;<input type="image" src="%s/images/exec16.png" value="update..." name="%s/portal_selections/viewSearchRelatedDocumentDialog%s_%s:method">' \
                     %  (portal_url_string, portal_object.getPath(), field.aq_parent._v_relation_field_index, i)
 
@@ -159,8 +159,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, RelationField.R
           # no modification made, we can display only a lines text area widget
           html_string += Widget.LinesTextAreaWidget.render(self, field, key, value_list, REQUEST)
 
-          if field.get_value('allow_jump') == 1 :
-            html_string += '&nbsp;<input type="image" src="%s/images/exec16.png" value="update..." name="%s/portal_selections/viewSearchRelatedDocumentDialog%s:method">' \
+          html_string += '&nbsp;<input type="image" src="%s/images/exec16.png" value="update..." name="%s/portal_selections/viewSearchRelatedDocumentDialog%s:method">' \
               %  (portal_url_string, portal_object.getPath(), field.aq_parent._v_relation_field_index)
 
           if value_list not in ((), [], None, ['']) and value_list == field.get_value('default') and field.get_value('allow_jump') == 1 :
diff --git a/product/ERP5Form/RelationField.py b/product/ERP5Form/RelationField.py
index 704b6035a5..e499303f28 100755
--- a/product/ERP5Form/RelationField.py
+++ b/product/ERP5Form/RelationField.py
@@ -188,7 +188,7 @@ class RelationStringFieldWidget(Widget.TextWidget, Widget.ListWidget):
         # we compare what has been changed in the relation update script
 
         #elif value != field.get_value('default'):
-        elif field.get_value('allow_jump') == 1 :
+        else:
             html_string += '&nbsp;<input type="image" src="%s/images/exec16.png" value="update..." name="%s/portal_selections/viewSearchRelatedDocumentDialog%s:method">' \
               %  (portal_url_string, portal_object.getPath(),
                   getattr(field.aq_parent, '_v_relation_field_index', 0))
-- 
2.30.9