From 7fcd6fe4c768113bc5133a7b7b092f1a6d8bfb6c Mon Sep 17 00:00:00 2001
From: Nicolas Delaby <nicolas@nexedi.com>
Date: Wed, 10 Nov 2010 16:30:56 +0000
Subject: [PATCH] Call global method from portal itself to avoid acquisition
 lookup

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

diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_getFastInputLineList.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_getFastInputLineList.xml
index 28ee9a62df..cc3616e218 100644
--- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_getFastInputLineList.xml
+++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_getFastInputLineList.xml
@@ -59,12 +59,12 @@
 """\n
 from Products.ERP5Type.Document import newTempBase\n
 request = context.REQUEST\n
+portal = context.getPortalObject()\n
 trade_document = context\n
 result = []\n
-\n
 # Retrieve lines portal type\n
 line_portal_type_list = [x for x in context.getTypeInfo().getTypeAllowedContentTypeList() \\\n
-                         if x in context.getPortalMovementTypeList()]\n
+                         if x in portal.getPortalMovementTypeList()]\n
 line_portal_type = line_portal_type_list[0]\n
 \n
 if read_document_lines:\n
@@ -72,11 +72,11 @@ if read_document_lines:\n
 else:\n
   line_list = []\n
 \n
-if line_portal_type in context.getPortalSaleTypeList():\n
+if line_portal_type in portal.getPortalSaleTypeList():\n
   section_uid = context.getSourceSectionUid()\n
-elif line_portal_type in context.getPortalPurchaseTypeList():\n
+elif line_portal_type in portal.getPortalPurchaseTypeList():\n
   section_uid = context.getDestinationSectionUid()\n
-elif line_portal_type in context.getPortalInternalTypeList() + context.getPortalInventoryMovementTypeList():\n
+elif line_portal_type in portal.getPortalInternalTypeList() + portal.getPortalInventoryMovementTypeList():\n
   section_uid = None\n
 len_line_list = len(line_list)\n
 used_id = [] # list use to make sure we do not generate two line with same id/uid\n
@@ -203,7 +203,7 @@ if read_document_lines is False:\n
      # if a resource is selected, use it\n
      if resource_relative_url not in (\'\',None):\n
        empty_line_cpt -= 1\n
-       resource = context.restrictedTraverse(resource_relative_url)\n
+       resource = portal.restrictedTraverse(resource_relative_url)\n
        obj.setResourceValue(resource)\n
      empty_line_cpt += 1\n
      result_append(obj)\n
@@ -255,6 +255,7 @@ return result\n
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>request</string>
+                            <string>portal</string>
                             <string>trade_document</string>
                             <string>result</string>
                             <string>append</string>
diff --git a/bt5/erp5_trade/bt/revision b/bt5/erp5_trade/bt/revision
index 7e68ad78cb..23cbfa7704 100644
--- a/bt5/erp5_trade/bt/revision
+++ b/bt5/erp5_trade/bt/revision
@@ -1 +1 @@
-1023
\ No newline at end of file
+1024
\ No newline at end of file
-- 
2.30.9