Commit bc27bf38 authored by Vincent Pelletier's avatar Vincent Pelletier

Make it faster (still not perfect) to search in Checkbook Vault Transfer fast input.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28158 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 706879c0
...@@ -105,9 +105,18 @@ if listbox is None:\n ...@@ -105,9 +105,18 @@ if listbox is None:\n
if disable_node:\n if disable_node:\n
node=None\n node=None\n
\n \n
current_tracking_list = getCurrentTrackingList(to_date=at_date,\n kw = {}\n
node=node,\n if reference not in (None, \'\'):\n
where_expression="item_catalog.portal_type=\'Check\' or item_catalog.portal_type=\'Checkbook\'")\n kw[\'aggregate_uid\'] = [x.uid for x in context.getPortalObject().portal_catalog(\n
destination_payment_internal_bank_account_number=reference,\n
portal_type=(\'Check\', \'Checkbook\')\n
)]\n
\n
current_tracking_list = getCurrentTrackingList(\n
to_date=at_date,\n
node=node,\n
where_expression="item_catalog.portal_type=\'Check\' or item_catalog.portal_type=\'Checkbook\'",\n
**kw)\n
\n \n
if count is True:\n if count is True:\n
return len(current_tracking_list)\n return len(current_tracking_list)\n
...@@ -146,8 +155,6 @@ if listbox is None:\n ...@@ -146,8 +155,6 @@ if listbox is None:\n
destination_payment_value = item.getDestinationPaymentValue()\n destination_payment_value = item.getDestinationPaymentValue()\n
if destination_payment_value is not None:\n if destination_payment_value is not None:\n
internal_bank_account_number = destination_payment_value.getInternalBankAccountNumber()\n internal_bank_account_number = destination_payment_value.getInternalBankAccountNumber()\n
if reference not in (None, \'\') and reference != internal_bank_account_number:\n
continue\n
item_dict[\'internal_bank_account_number\'] = internal_bank_account_number\n item_dict[\'internal_bank_account_number\'] = internal_bank_account_number\n
item_dict[\'account_owner\'] = item.getDestinationPaymentTitle()\n item_dict[\'account_owner\'] = item.getDestinationPaymentTitle()\n
item_dict[\'recept_date\'] = item.getStartDate()\n item_dict[\'recept_date\'] = item.getStartDate()\n
...@@ -244,6 +251,11 @@ return listbox\n ...@@ -244,6 +251,11 @@ return listbox\n
<string>context</string> <string>context</string>
<string>item_list</string> <string>item_list</string>
<string>getCurrentTrackingList</string> <string>getCurrentTrackingList</string>
<string>append</string>
<string>$append0</string>
<string>x</string>
<string>_write_</string>
<string>_apply_</string>
<string>current_tracking_list</string> <string>current_tracking_list</string>
<string>True</string> <string>True</string>
<string>len</string> <string>len</string>
...@@ -255,7 +267,6 @@ return listbox\n ...@@ -255,7 +267,6 @@ return listbox\n
<string>value</string> <string>value</string>
<string>item_portal_type</string> <string>item_portal_type</string>
<string>item_dict</string> <string>item_dict</string>
<string>_write_</string>
<string>destination_payment_value</string> <string>destination_payment_value</string>
<string>internal_bank_account_number</string> <string>internal_bank_account_number</string>
<string>_inplacevar_</string> <string>_inplacevar_</string>
......
...@@ -83,11 +83,17 @@ if fast_input_type == \'traveler_check_purchase\':\n ...@@ -83,11 +83,17 @@ if fast_input_type == \'traveler_check_purchase\':\n
item_portal_type_list = (\'Check\',)\n item_portal_type_list = (\'Check\',)\n
disable_node = 1\n disable_node = 1\n
\n \n
# retrieve reference field to filter list\n
reference = getattr(request, \'your_reference\', None)\n
if reference is None:\n
reference = getattr(request, \'field_your_reference\', None)\n
\n
nb = context.Delivery_getCheckbookList(\n nb = context.Delivery_getCheckbookList(\n
item_portal_type_list=item_portal_type_list,\n item_portal_type_list=item_portal_type_list,\n
disable_node=disable_node,\n disable_node=disable_node,\n
at_date=at_date,\n at_date=at_date,\n
node=node,\n node=node,\n
reference=reference,\n
count=True)\n count=True)\n
\n \n
return [[nb,],]\n return [[nb,],]\n
...@@ -151,6 +157,7 @@ return [[nb,],]\n ...@@ -151,6 +157,7 @@ return [[nb,],]\n
<string>fast_input_type</string> <string>fast_input_type</string>
<string>disable_node</string> <string>disable_node</string>
<string>at_date</string> <string>at_date</string>
<string>reference</string>
<string>True</string> <string>True</string>
<string>nb</string> <string>nb</string>
</tuple> </tuple>
......
431 432
\ 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