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 ...@@ -72,11 +72,17 @@ from ZTUtils import make_query\n
from ZODB.POSException import ConflictError\n from ZODB.POSException import ConflictError\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
getobject = portal.portal_catalog.getobject\n getobject = portal.portal_catalog.getobject\n
stool = portal.portal_selections\n
N_ = portal.Base_translateString\n N_ = portal.Base_translateString\n
psm = N_(\'Nothing matches\')\n psm = N_(\'Nothing matches\')\n
request = container.REQUEST\n request = container.REQUEST\n
precision = request.get(\'precision\', 2)\n precision = request.get(\'precision\', 2)\n
\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 # XXX when should it be validated ?\n
if node == \'\':\n if node == \'\':\n
node = context.REQUEST.get(\'field_your_node\', node)\n node = context.REQUEST.get(\'field_your_node\', node)\n
...@@ -107,11 +113,6 @@ if uids:\n ...@@ -107,11 +113,6 @@ if uids:\n
request.set(\'total_selected_amount\', total_selected_amount)\n request.set(\'total_selected_amount\', total_selected_amount)\n
\n \n
if update:\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 request.set(\'portal_status_message\', N_(\'Updated\'))\n
return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)\n return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)\n
\n \n
...@@ -123,6 +124,9 @@ if grouping == \'grouping\':\n ...@@ -123,6 +124,9 @@ if grouping == \'grouping\':\n
if grouped_line_list:\n if grouped_line_list:\n
psm = N_(\'${grouped_line_count} Lines Grouped\',\n psm = N_(\'${grouped_line_count} Lines Grouped\',\n
mapping=dict(grouped_line_count=len(grouped_line_list)))\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 \n
# we check if we can mark some transaction as payed.\n # we check if we can mark some transaction as payed.\n
transaction_list = {}\n transaction_list = {}\n
...@@ -174,6 +178,9 @@ else:\n ...@@ -174,6 +178,9 @@ else:\n
\n \n
psm = N_(\'${ungrouped_line_count} Lines Ungrouped\',\n psm = N_(\'${ungrouped_line_count} Lines Ungrouped\',\n
mapping=dict(ungrouped_line_count=len(ungrouped_line_list)))\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 \n
request.set(\'portal_status_message\', psm)\n request.set(\'portal_status_message\', psm)\n
return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)\n return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)\n
...@@ -199,7 +206,7 @@ return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)\ ...@@ -199,7 +206,7 @@ return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)\
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <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>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -228,7 +235,7 @@ return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)\ ...@@ -228,7 +235,7 @@ return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)\
<string>uids</string> <string>uids</string>
<string>listbox</string> <string>listbox</string>
<string>listbox_uid</string> <string>listbox_uid</string>
<string>selection_name</string> <string>list_selection_name</string>
<string>grouping</string> <string>grouping</string>
<string>node</string> <string>node</string>
<string>mirror_section</string> <string>mirror_section</string>
...@@ -242,6 +249,7 @@ return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)\ ...@@ -242,6 +249,7 @@ return context.AccountingTransactionModule_viewGroupingFastInputDialog(request)\
<string>context</string> <string>context</string>
<string>portal</string> <string>portal</string>
<string>getobject</string> <string>getobject</string>
<string>stool</string>
<string>N_</string> <string>N_</string>
<string>psm</string> <string>psm</string>
<string>container</string> <string>container</string>
......
...@@ -73,7 +73,7 @@ return context.AccountingTransactionModule_setGroupingReference(\n ...@@ -73,7 +73,7 @@ return context.AccountingTransactionModule_setGroupingReference(\n
uids=uids,\n uids=uids,\n
listbox=listbox,\n listbox=listbox,\n
listbox_uid=listbox_uid,\n listbox_uid=listbox_uid,\n
selection_name=list_selection_name,\n list_selection_name=list_selection_name,\n
node=node,\n node=node,\n
mirror_section=mirror_section,\n mirror_section=mirror_section,\n
update=1)\n update=1)\n
......
656 657
\ 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