Commit 33252d75 authored by Jérome Perrin's avatar Jérome Perrin

Delivery Line export: display source/destination trade and use a larger limit

parent 2cb94dac
......@@ -55,12 +55,21 @@ line_list = []\n
request = context.REQUEST\n
portal = context.getPortalObject()\n
\n
checked_uid_list = portal.portal_selections.getSelectionCheckedUidsFor(module_selection_name)\n
if checked_uid_list:\n
# XXX use a larger limit\n
saved_selection_params = context.getPortalObject().portal_selections.getSelectionParamsFor(module_selection_name)\n
selection_params = saved_selection_params.copy()\n
selection_params[\'limit\'] = 10000\n
context.getPortalObject().portal_selections.setSelectionParamsFor(module_selection_name, selection_params)\n
\n
try:\n
checked_uid_list = portal.portal_selections.getSelectionCheckedUidsFor(module_selection_name)\n
if checked_uid_list:\n
getObject = portal.portal_catalog.getObject\n
delivery_list = [getObject(uid) for uid in checked_uid_list]\n
else:\n
else:\n
delivery_list = portal.portal_selections.callSelectionFor(module_selection_name, context=context)\n
finally:\n
context.getPortalObject().portal_selections.setSelectionParamsFor(module_selection_name, saved_selection_params)\n
\n
account_title_cache = dict()\n
def getAccountTitle(relative_url):\n
......@@ -95,6 +104,8 @@ for delivery in delivery_list:\n
destination_section_title=movement.getDestinationSectionTitle(),\n
source_administration_title=movement.getSourceAdministrationTitle(),\n
destination_administration_title=movement.getDestinationAdministrationTitle(),\n
source_trade_title=movement.getSourceTradeTitle(),\n
destination_trade_title=movement.getDestinationTradeTitle(),\n
source_function_title=movement.getSourceFunctionTitle(),\n
destination_function_title=movement.getDestinationFunctionTitle(),\n
source_decision_title=movement.getSourceDecisionTitle(),\n
......
......@@ -10,14 +10,14 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>editable_columns</string>
<string>title</string>
<string>selection_name</string>
<string>default_params</string>
<string>list_method</string>
<string>columns</string>
<string>default_params</string>
<string>editable_columns</string>
<string>lines</string>
<string>list_action</string>
<string>list_method</string>
<string>selection_name</string>
<string>title</string>
</list>
</value>
</item>
......@@ -178,6 +178,14 @@
<string>destination_account</string>
<string>Destination Account</string>
</tuple>
<tuple>
<string>source_trade_title</string>
<string>Source Trade</string>
</tuple>
<tuple>
<string>destination_trade_title</string>
<string>Destination Trade</string>
</tuple>
<tuple>
<string>start_date</string>
<string>Shipping Date</string>
......@@ -279,6 +287,14 @@
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
<item>
<key> <string>lines</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>list_action</string> </key>
<value> <string>list</string> </value>
</item>
<item>
<key> <string>list_method</string> </key>
<value>
......
1173
\ No newline at end of file
1174
\ 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