Commit 37f77c96 authored by Jérome Perrin's avatar Jérome Perrin

Fix grouping dialog for multiple page selections

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20124 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d6394a54
......@@ -72,11 +72,17 @@ from ZTUtils import make_query\n
from ZODB.POSException import ConflictError\n
portal = context.getPortalObject()\n
getobject = portal.portal_catalog.getobject\n
stool = portal.portal_selections\n
N_ = portal.Base_translateString\n
psm = N_(\'Nothing matches\')\n
request = container.REQUEST\n
precision = request.get(\'precision\', 2)\n
\n
# update selected uids \n
stool.updateSelectionCheckedUidList(\n
list_selection_name, uids=uids, listbox_uid=listbox_uid, REQUEST=request)\n
uids = stool.getSelectionCheckedUidsFor(list_selection_name)\n
\n
# XXX when should it be validated ?\n
if node == \'\':\n
node = context.REQUEST.get(\'field_your_node\', node)\n
......@@ -107,11 +113,6 @@ if uids:\n
request.set(\'total_selected_amount\', total_selected_amount)\n
\n
if update:\n
# update selected uids \n
portal.portal_selections.updateSelectionCheckedUidList(\n
selection_name, uids=uids, listbox_uid=listbox_uid,\n
REQUEST=context.REQUEST)\n
\n
request.set(\'portal_status_message\', N_(\'Updated\'))\n
return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)\n
\n
......@@ -123,6 +124,9 @@ if grouping == \'grouping\':\n
if grouped_line_list:\n
psm = N_(\'${grouped_line_count} Lines Grouped\',\n
mapping=dict(grouped_line_count=len(grouped_line_list)))\n
\n
# make sure nothing will be checked next time\n
stool.setSelectionCheckedUidsFor(list_selection_name, [])\n
\n
# we check if we can mark some transaction as payed.\n
transaction_list = {}\n
......@@ -174,6 +178,9 @@ else:\n
\n
psm = N_(\'${ungrouped_line_count} Lines Ungrouped\',\n
mapping=dict(ungrouped_line_count=len(ungrouped_line_list)))\n
\n
# make sure nothing will be checked next time\n
stool.setSelectionCheckedUidsFor(list_selection_name, [])\n
\n
request.set(\'portal_status_message\', psm)\n
return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)\n
......@@ -199,7 +206,7 @@ return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)\
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>uids=[], listbox=None, listbox_uid=[], selection_name=\'\', grouping=\'\', node=\'\', mirror_section=\'\', update=0, **kw</string> </value>
<value> <string>uids=[], listbox=None, listbox_uid=[], list_selection_name=\'\', grouping=\'\', node=\'\', mirror_section=\'\', update=0, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -228,7 +235,7 @@ return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)\
<string>uids</string>
<string>listbox</string>
<string>listbox_uid</string>
<string>selection_name</string>
<string>list_selection_name</string>
<string>grouping</string>
<string>node</string>
<string>mirror_section</string>
......@@ -242,6 +249,7 @@ return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)\
<string>context</string>
<string>portal</string>
<string>getobject</string>
<string>stool</string>
<string>N_</string>
<string>psm</string>
<string>container</string>
......
......@@ -73,7 +73,7 @@ return context.AccountingTransactionModule_setGroupingReference(\n
uids=uids,\n
listbox=listbox,\n
listbox_uid=listbox_uid,\n
selection_name=list_selection_name,\n
list_selection_name=list_selection_name,\n
node=node,\n
mirror_section=mirror_section,\n
update=1)\n
......
656
\ No newline at end of file
657
\ 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