From 297de379811168d845c3e07a024cf4d0ddb87c01 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Wed, 2 Nov 2005 09:48:26 +0000
Subject: [PATCH] make sure to not take non editable relation fields

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4201 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/SelectionTool.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/product/ERP5Form/SelectionTool.py b/product/ERP5Form/SelectionTool.py
index 803778c33d..fe0540013a 100755
--- a/product/ERP5Form/SelectionTool.py
+++ b/product/ERP5Form/SelectionTool.py
@@ -817,6 +817,7 @@ class SelectionTool( UniqueObject, SimpleItem ):
         if isinstance(v,DateTime):
           del kw[k]
       # XXX End of the part to remove
+      LOG('SelectionTool.getPickle, kw',0,kw)
       pickle_string = pickle.dumps(kw)
       msg = MIMEBase('application','octet-stream')
       msg.set_payload(pickle_string)
@@ -934,7 +935,13 @@ class SelectionTool( UniqueObject, SimpleItem ):
       relation_index = 0
 
       # find the correct field
+      field_list = []
+      # XXX may be should support another parameter,
+      # like include_non_editable=0
       for field in form.get_fields(include_disabled=0):
+        if field.get_value('editable',REQUEST=REQUEST):
+          field_list.append(field)
+      for field in field_list:
         if getattr(field, 'is_relation_field', None):
           if index == relation_index:
             break
-- 
2.30.9