From cb212f66871798acc91b18b0f67578e378e740df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Mon, 4 Feb 2008 19:29:31 +0000
Subject: [PATCH] Don't use context.REQUEST.AUTHENTICATED_USER, it doesn't work
 in ZopeTestCase

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19034 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../AccountingTransactionLine_getNodeItemList.xml          | 7 ++++++-
 bt5/erp5_accounting/bt/revision                            | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionLine_getNodeItemList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionLine_getNodeItemList.xml
index bdc57d2b65..a328aba36f 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionLine_getNodeItemList.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionLine_getNodeItemList.xml
@@ -72,6 +72,8 @@ If `mirror` is set to a true value, the list will be filtered for the mirror\n
 node.\n
 """\n
 from Products.ERP5Type.Cache import CachingMethod\n
+from AccessControl import getSecurityManager\n
+\n
 portal = context.getPortalObject()\n
 \n
 if omit_filter:\n
@@ -149,7 +151,7 @@ return getItemList( category=category,\n
                     portal_path=context.getPortalObject().getPhysicalPath(),\n
                     mirror=mirror,\n
                     omit_filter=omit_filter, # XXX possible optim: only one cache if omit_filter\n
-                    user_name=context.REQUEST.AUTHENTICATED_USER,\n
+                    user_name=str(getSecurityManager().getUser()),\n
                     simulation_state=context.getProperty(\n
                           \'simulation_state\', \'no_simulation_state\') )\n
 </string> </value>
@@ -204,6 +206,8 @@ return getItemList( category=category,\n
                             <string>omit_filter</string>
                             <string>Products.ERP5Type.Cache</string>
                             <string>CachingMethod</string>
+                            <string>AccessControl</string>
+                            <string>getSecurityManager</string>
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>portal</string>
@@ -215,6 +219,7 @@ return getItemList( category=category,\n
                             <string>sort</string>
                             <string>None</string>
                             <string>getItemList</string>
+                            <string>str</string>
                           </tuple>
                         </value>
                     </item>
diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision
index 51f1d23291..b094da400f 100644
--- a/bt5/erp5_accounting/bt/revision
+++ b/bt5/erp5_accounting/bt/revision
@@ -1 +1 @@
-566
\ No newline at end of file
+568
\ No newline at end of file
-- 
2.30.9