Commit 6417743b authored by Grégory Wisniewski's avatar Grégory Wisniewski

Allow filter by checkbook model and title in checkbook delivery.

Add to search fields in the fast input to easily search for checks.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37833 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c60a9de9
......@@ -96,6 +96,8 @@
<list>
<string>your_fast_input_type</string>
<string>your_reference</string>
<string>your_title</string>
<string>your_checkbook_model</string>
</list>
</value>
</item>
......
......@@ -426,7 +426,7 @@
</item>
<item>
<key> <string>lines</string> </key>
<value> <int>20</int> </value>
<value> <int>50</int> </value>
</item>
<item>
<key> <string>list_action</string> </key>
......
......@@ -99,11 +99,22 @@ if listbox is None:\n
destination_payment_internal_bank_account_number=reference,\n
portal_type=(\'Check\', \'Checkbook\')\n
)]\n
\n
if checkbook_model not in (None, \'\'):\n
checkbook_model_uid = context.getPortalObject().restrictedTraverse(checkbook_model).getUid()\n
kw[\'resource_uid\'] = checkbook_model_uid\n
\n
search_criterion = \'\'\n
if title not in (None, \'\'):\n
# FIXME: this doesn\'t work with current catalog and simulation tool\n
# build a SQL statement to bypass this limitation\n
#kw[\'item_catalog.title\'] = title\n
search_criterion = " AND item_catalog.title LIKE \'%s\'" % title\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
where_expression="item_catalog.portal_type=\'Check\' or item_catalog.portal_type=\'Checkbook\' %s" % search_criterion,\n
**kw)\n
\n
if count is True:\n
......@@ -168,7 +179,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,reference=None,limit=None,count=False,**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,checkbook_model=None,title=None,limit=None,count=False,**kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
......@@ -196,7 +207,7 @@ return listbox\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>11</int> </value>
<value> <int>13</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
......@@ -211,6 +222,8 @@ return listbox\n
<string>disable_node</string>
<string>at_date</string>
<string>reference</string>
<string>checkbook_model</string>
<string>title</string>
<string>limit</string>
<string>count</string>
<string>kw</string>
......@@ -231,6 +244,8 @@ return listbox\n
<string>$append0</string>
<string>x</string>
<string>_write_</string>
<string>checkbook_model_uid</string>
<string>search_criterion</string>
<string>_apply_</string>
<string>current_tracking_list</string>
<string>True</string>
......@@ -268,6 +283,8 @@ return listbox\n
<none/>
<none/>
<none/>
<none/>
<none/>
<int>0</int>
</tuple>
</value>
......
......@@ -76,12 +76,24 @@ reference = getattr(request, \'your_reference\', None)\n
if reference is None:\n
reference = getattr(request, \'field_your_reference\', None)\n
\n
# filter by checkbook model\n
checkbook_model = getattr(request, \'your_checkbook_model\', None)\n
if checkbook_model is None:\n
checkbook_model = getattr(request, \'field_your_checkbook_model\', None)\n
\n
# filter by title (check numbers)\n
title = getattr(request, \'your_title\', None)\n
if title is None:\n
title = getattr(request, \'field_your_title\', None)\n
\n
nb = context.Delivery_getCheckbookList(\n
item_portal_type_list=item_portal_type_list,\n
disable_node=disable_node,\n
at_date=at_date,\n
node=node,\n
reference=reference,\n
title=title,\n
checkbook_model=checkbook_model, \n
count=True)\n
\n
return [[nb,],]\n
......@@ -134,6 +146,8 @@ return [[nb,],]\n
<string>disable_node</string>
<string>at_date</string>
<string>reference</string>
<string>checkbook_model</string>
<string>title</string>
<string>True</string>
<string>nb</string>
</tuple>
......
......@@ -77,6 +77,16 @@ reference = getattr(request, \'your_reference\', None)\n
if reference is None:\n
reference = getattr(request, \'field_your_reference\', None)\n
\n
# filter by checkbook model\n
checkbook_model = getattr(request, \'your_checkbook_model\', None)\n
if checkbook_model is None:\n
checkbook_model = getattr(request, \'field_your_checkbook_model\', None)\n
\n
# filter by title (check numbers)\n
title = getattr(request, \'your_title\', None)\n
if title is None:\n
title = getattr(request, \'field_your_title\', None)\n
\n
disable_node = 0\n
at_date = context.getStartDate()\n
if fast_input_type == \'traveler_check_purchase\':\n
......@@ -108,6 +118,8 @@ listbox = context.Delivery_getCheckbookList(\n
at_date=at_date,\n
node=node,\n
reference=reference,\n
title=title,\n
checkbook_model=checkbook_model,\n
limit=limit)\n
context.Base_updateDialogForm(listbox=listbox)\n
\n
......@@ -166,6 +178,8 @@ return context.ListBox_initializeFastInput()\n
<string>getattr</string>
<string>fast_input_type</string>
<string>reference</string>
<string>checkbook_model</string>
<string>title</string>
<string>disable_node</string>
<string>at_date</string>
<string>_write_</string>
......
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