Commit 7fcd6fe4 authored by Nicolas Delaby's avatar Nicolas Delaby

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
parent 7bee746b
...@@ -59,12 +59,12 @@ ...@@ -59,12 +59,12 @@
"""\n """\n
from Products.ERP5Type.Document import newTempBase\n from Products.ERP5Type.Document import newTempBase\n
request = context.REQUEST\n request = context.REQUEST\n
portal = context.getPortalObject()\n
trade_document = context\n trade_document = context\n
result = []\n result = []\n
\n
# Retrieve lines portal type\n # Retrieve lines portal type\n
line_portal_type_list = [x for x in context.getTypeInfo().getTypeAllowedContentTypeList() \\\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 line_portal_type = line_portal_type_list[0]\n
\n \n
if read_document_lines:\n if read_document_lines:\n
...@@ -72,11 +72,11 @@ if read_document_lines:\n ...@@ -72,11 +72,11 @@ if read_document_lines:\n
else:\n else:\n
line_list = []\n line_list = []\n
\n \n
if line_portal_type in context.getPortalSaleTypeList():\n if line_portal_type in portal.getPortalSaleTypeList():\n
section_uid = context.getSourceSectionUid()\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 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 section_uid = None\n
len_line_list = len(line_list)\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 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 ...@@ -203,7 +203,7 @@ if read_document_lines is False:\n
# if a resource is selected, use it\n # if a resource is selected, use it\n
if resource_relative_url not in (\'\',None):\n if resource_relative_url not in (\'\',None):\n
empty_line_cpt -= 1\n empty_line_cpt -= 1\n
resource = context.restrictedTraverse(resource_relative_url)\n resource = portal.restrictedTraverse(resource_relative_url)\n
obj.setResourceValue(resource)\n obj.setResourceValue(resource)\n
empty_line_cpt += 1\n empty_line_cpt += 1\n
result_append(obj)\n result_append(obj)\n
...@@ -255,6 +255,7 @@ return result\n ...@@ -255,6 +255,7 @@ return result\n
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>request</string> <string>request</string>
<string>portal</string>
<string>trade_document</string> <string>trade_document</string>
<string>result</string> <string>result</string>
<string>append</string> <string>append</string>
......
1023 1024
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment