From 1132ce50e29e0dc4dea20e50a3effe2953395735 Mon Sep 17 00:00:00 2001
From: Yusei Tahara <yusei@nexedi.com>
Date: Wed, 16 Jan 2008 15:48:11 +0000
Subject: [PATCH] To use field id and argument id were not enough to generate
 unique key. So I added field's oid in addition.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18747 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/Form.py       | 8 ++++++--
 product/ERP5Form/ProxyField.py | 8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/product/ERP5Form/Form.py b/product/ERP5Form/Form.py
index 3f65f8f765..6386bc9a77 100644
--- a/product/ERP5Form/Form.py
+++ b/product/ERP5Form/Form.py
@@ -123,7 +123,9 @@ class TALESValue(StaticValue):
       # Proxyfield stores the "real" field in the request. Look if the
       # corresponding field exists in request, and use it as field in the
       # TALES context 
-      field = REQUEST.get('field__proxyfield_%s_%s' % (field.id, id), field)
+      field = REQUEST.get(
+        'field__proxyfield_%s_%s_%s' % (field.id, field._p_oid, id),
+        field)
 
     kw['field'] = field
 
@@ -259,7 +261,9 @@ def getFieldValue(self, field, id, **kw):
 def get_value(self, id, **kw):
   REQUEST = get_request()
   if REQUEST is not None:
-    field = REQUEST.get('field__proxyfield_%s_%s' % (self.id, id), self)
+    field = REQUEST.get(
+      'field__proxyfield_%s_%s_%s' % (self.id, self._p_oid, id),
+      self)
   else:
     field = self
 
diff --git a/product/ERP5Form/ProxyField.py b/product/ERP5Form/ProxyField.py
index 94e092ed12..5a385e160f 100644
--- a/product/ERP5Form/ProxyField.py
+++ b/product/ERP5Form/ProxyField.py
@@ -594,8 +594,12 @@ class ProxyField(ZMIField):
     field = self
     proxy_field = self.getTemplateField()
     if proxy_field is not None and REQUEST is not None:
-      field = REQUEST.get('field__proxyfield_%s_%s' % (self.id, id), self)
-      REQUEST.set('field__proxyfield_%s_%s' % (proxy_field.id, id), field)
+      field = REQUEST.get(
+        'field__proxyfield_%s_%s_%s' % (self.id, self._p_oid, id),
+        self)
+      REQUEST.set(
+        'field__proxyfield_%s_%s_%s' % (proxy_field.id, proxy_field._p_oid, id),
+        field)
 
     # Don't use cache if field is not stored in zodb, or if target field is
     # defined by a TALES
-- 
2.30.9