From 59fc2aff00ffc5e13adece0f026b10af1c45e59c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Thu, 9 Mar 2006 00:07:48 +0000
Subject: [PATCH] Patched version of Formulator uses `key` to generate field
 keys in request, not field id, so DateTime fields displayed old value instead
 of value in request when validation failed.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6051 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/FormulatorPatch.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/product/ERP5Form/FormulatorPatch.py b/product/ERP5Form/FormulatorPatch.py
index 07cf1c832f..b2bcf6f6cb 100755
--- a/product/ERP5Form/FormulatorPatch.py
+++ b/product/ERP5Form/FormulatorPatch.py
@@ -573,7 +573,7 @@ def DateTimeField_get_default(self, key, value, REQUEST):
     # if there is something in the request then return None
     # sub fields should pick up defaults themselves
     if REQUEST is not None and hasattr(REQUEST, 'form') and \
-      REQUEST.form.has_key('subfield_%s_%s' % (self.id, 'year')):
+        REQUEST.form.has_key('subfield_%s_%s' % (key, 'year')):
         return None
     else:
         return self.get_value('default')
-- 
2.30.9