Commit ec466d3e authored by Aurel's avatar Aurel

- optmize the retrieval of checkbook

- add a reference field so that user can filter checkbook in fast input

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27906 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 965e64d8
......@@ -52,6 +52,10 @@
<key> <string>action</string> </key>
<value> <string>Delivery_saveCheckbookFastInputLine</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>None</string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
......@@ -103,6 +107,7 @@
<value>
<list>
<string>your_fast_input_type</string>
<string>your_reference</string>
</list>
</value>
</item>
......@@ -149,7 +154,7 @@
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
<value> <string>CheckbookDelivery_fastInputForm</string> </value>
</item>
</dictionary>
</pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="StringField" module="Products.Formulator.StandardFields"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_reference</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>too_long</string> </key>
<value> <string>Too much input was given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Bank Account Reference</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -95,14 +95,16 @@ if listbox is None:\n
listbox = []\n
if node is not None or disable_node:\n
getCurrentTrackingList = context.portal_simulation.getCurrentTrackingList\n
#context.log(\'Delivery_viewCheckbookInputDialog\', getCurrentTrackingList(at_date=at_date, node=node,src__=1,where_expression="item_catalog.portal_type=\'Check\' or item_catalog.portal_type=\'Checkbook\'"))\n
#return [x.path for x in getCurrentTrackingList(at_date=at_date, node=node)]\n
# context.log(\'Delivery_viewCheckbookInputDialog\', getCurrentTrackingList(at_date=at_date, node=node,src__=1,where_expression="item_catalog.portal_type=\'Check\' or item_catalog.portal_type=\'Checkbook\'"))\n
if disable_node:\n
node=None\n
current_tracking_list = [x.getObject() for x in getCurrentTrackingList(\n
to_date=at_date, node=node,\n
where_expression="item_catalog.portal_type=\'Check\' or item_catalog.portal_type=\'Checkbook\'")]\n
\n
current_tracking_list = getCurrentTrackingList(to_date=at_date,\n
node=node,\n
where_expression="item_catalog.portal_type=\'Check\' or item_catalog.portal_type=\'Checkbook\'")\n
\n
for item in current_tracking_list:\n
item = item.getObject()\n
exclude=0\n
if model_filter_dict is not None:\n
resource = item.getResourceValue()\n
......@@ -133,18 +135,18 @@ if listbox is None:\n
item_dict[\'internal_bank_account_number\'] = \'\'\n
destination_payment_value = item.getDestinationPaymentValue()\n
if destination_payment_value is not None:\n
item_dict[\'internal_bank_account_number\'] = destination_payment_value.getInternalBankAccountNumber()\n
internal_bank_account_number = destination_payment_value.getInternalBankAccountNumber()\n
if reference is not None and reference != internal_bank_account_number:\n
continue\n
item_dict[\'internal_bank_account_number\'] = internal_bank_account_number\n
item_dict[\'account_owner\'] = item.getDestinationPaymentTitle()\n
item_dict[\'recept_date\'] = item.getStartDate()\n
item_dict[\'selection\'] = 0\n
item_dict[\'uid\'] = \'new_%s\' %(item.getUid(),)\n
\n
listbox.append(item_dict)\n
\n
return listbox\n
#context.Base_updateDialogForm(listbox=listbox\n
# )\n
#return context.asContext(context=None\n
# , portal_type=context.getPortalType()\n
# ).CheckbookDelivery_fastInputForm(**kw)\n
</string> </value>
</item>
<item>
......@@ -167,7 +169,7 @@ return listbox\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>listbox=None, item_portal_type_list=None,destination_payment=None,model_filter_dict=None,batch_mode=0,simulation_state=None,disable_node=0,at_date=None,**kw</string> </value>
<value> <string>listbox=None, item_portal_type_list=None,destination_payment=None,model_filter_dict=None,batch_mode=0,simulation_state=None,disable_node=0,at_date=None,reference=None,**kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
......@@ -195,7 +197,7 @@ return listbox\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>8</int> </value>
<value> <int>9</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
......@@ -209,6 +211,7 @@ return listbox\n
<string>simulation_state</string>
<string>disable_node</string>
<string>at_date</string>
<string>reference</string>
<string>kw</string>
<string>DateTime</string>
<string>Dummy</string>
......@@ -220,11 +223,8 @@ return listbox\n
<string>context</string>
<string>item_list</string>
<string>getCurrentTrackingList</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>x</string>
<string>current_tracking_list</string>
<string>_getiter_</string>
<string>item</string>
<string>exclude</string>
<string>resource</string>
......@@ -234,6 +234,7 @@ return listbox\n
<string>item_dict</string>
<string>_write_</string>
<string>destination_payment_value</string>
<string>internal_bank_account_number</string>
</tuple>
</value>
</item>
......@@ -254,6 +255,7 @@ return listbox\n
<none/>
<int>0</int>
<none/>
<none/>
</tuple>
</value>
</item>
......
......@@ -86,8 +86,9 @@ fast_input_type = getattr(request, \'your_fast_input_type\', None)\n
if fast_input_type is None:\n
fast_input_type = getattr(request, \'field_your_fast_input_type\')\n
\n
context.log(\'ListBox_listCheckbook, fast_input_type\', fast_input_type)\n
\n
reference = getattr(request, \'your_reference\', None)\n
if reference is None:\n
reference = getattr(request, \'field_your_reference\', None)\n
\n
disable_node = 0\n
at_date = context.getStartDate()\n
......@@ -111,8 +112,6 @@ elif fast_input_type == \'checkbook_usual_cash_transfer\':\n
model_filter_dict[\'fixed_price\']=1\n
item_portal_type_list = (\'Check\',)\n
\n
\n
\n
listbox = context.Delivery_getCheckbookList(\n
item_portal_type_list=item_portal_type_list,\n
destination_payment=destination_payment,\n
......@@ -120,9 +119,11 @@ listbox = context.Delivery_getCheckbookList(\n
simulation_state=simulation_state,\n
disable_node=disable_node,\n
at_date=at_date,\n
node=node)\n
node=node,\n
reference=reference)\n
\n
context.Base_updateDialogForm(listbox=listbox)\n
\n
return context.ListBox_initializeFastInput()\n
</string> </value>
</item>
......@@ -190,6 +191,7 @@ return context.ListBox_initializeFastInput()\n
<string>model_filter_dict</string>
<string>getattr</string>
<string>fast_input_type</string>
<string>reference</string>
<string>disable_node</string>
<string>at_date</string>
<string>_write_</string>
......
423
\ No newline at end of file
425
\ 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